mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
Tasksh
- When a command encountered is not supported directly by tasksh, simply send it to Taskwarrior.
This commit is contained in:
parent
bba1bbcaaa
commit
70454c35b9
3 changed files with 14 additions and 2 deletions
|
@ -38,7 +38,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int cmdDiagnostics ()
|
||||
{
|
||||
std::cout << "diagnostics\n";
|
||||
std::cout << "tasksh diagnostics\n";
|
||||
|
||||
// TODO Version
|
||||
// TODO Platform
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int cmdHelp ()
|
||||
{
|
||||
std::cout << "help\n";
|
||||
std::cout << "tasksh help\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
12
src/main.cpp
12
src/main.cpp
|
@ -26,7 +26,9 @@
|
|||
|
||||
#include <cmake.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <stdlib.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
|
||||
|
@ -43,6 +45,7 @@
|
|||
int cmdHelp ();
|
||||
int cmdDiagnostics ();
|
||||
std::string composePrompt ();
|
||||
std::string findTaskwarrior ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static int commandLoop ()
|
||||
|
@ -81,6 +84,15 @@ static int commandLoop ()
|
|||
else if (closeEnough ("quit", command, 3)) status = 1;
|
||||
else if (closeEnough ("help", command, 3)) status = cmdHelp ();
|
||||
else if (closeEnough ("diagnostics", command, 3)) status = cmdDiagnostics ();
|
||||
else
|
||||
{
|
||||
std::cout << "[task " << command << "]\n";
|
||||
command = "task " + command;
|
||||
system (command.c_str ());
|
||||
|
||||
// Deliberately ignoreѕ taskwarrior exit status, otherwise empty filters
|
||||
// cause the shell to terminate.
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue