- Prompt composition is factored out into a separate function. The prompt is
  going to be a big feature, and needs room for processing.
This commit is contained in:
Paul Beckingham 2014-06-21 07:08:32 -04:00
parent 710128c7d7
commit d1a9228b41
3 changed files with 43 additions and 2 deletions

View file

@ -35,14 +35,18 @@
#include <readline/history.h>
#endif
// tasksh commands.
int cmdHelp ();
int cmdDiagnostics ();
std::string composePrompt ();
////////////////////////////////////////////////////////////////////////////////
static int commandLoop ()
{
// TODO Compose prompt.
std::string prompt = "task> ";
// TODO Local data: timer, context stack. No globals.
// Compose the prompt.
std::string prompt = composePrompt ();
// Display prompt, get input.
char *line_read = readline (prompt.c_str ());