diff --git a/src/diag.cpp b/src/diag.cpp index c8286d6..4a81ad2 100644 --- a/src/diag.cpp +++ b/src/diag.cpp @@ -40,6 +40,12 @@ int cmdDiagnostics () { std::cout << "diagnostics\n"; + // TODO Version + // TODO Platform + // TODO pthreads + // TODO libreadline + // TODO Taskwarrior version + location + return 0; } diff --git a/src/main.cpp b/src/main.cpp index 1fc43c0..f7ecc1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,10 @@ #include #endif +// TODO These conflict with tw commands. This needs to be resolved. +// Perhaps an escape, such as '-- help' could invoke local help, or using +// a 'task' prefix could disambiguate. + // tasksh commands. int cmdHelp (); int cmdDiagnostics (); @@ -49,6 +53,7 @@ static int commandLoop () std::string prompt = composePrompt (); // Display prompt, get input. +#ifdef HAVE_READLINE char *line_read = readline (prompt.c_str ()); if (! line_read) { @@ -62,6 +67,13 @@ static int commandLoop () std::string command (line_read); free (line_read); +#else + std::cout << prompt; + std::string command; + std::getline (std::cin, command); + if (command.find ('\n') == std::string::npos) + std::cout << "\n"; +#endif // Dispatch command int status = 0; @@ -70,8 +82,6 @@ static int commandLoop () else if (closeEnough ("help", command, 3)) status = cmdHelp (); else if (closeEnough ("diagnostics", command, 3)) status = cmdDiagnostics (); - // TODO help - return status; }