mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
Prompt
- 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:
parent
710128c7d7
commit
d1a9228b41
3 changed files with 43 additions and 2 deletions
|
@ -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 ());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue