X-Git-Url: https://git.armaanb.net/?p=gen-shell.git;a=blobdiff_plain;f=src%2Fprompt.cpp;h=493425a9a6b03854932b0f7f2b23f67a0dad0b41;hp=5b2e0487ae0284f95d7beccfcabbd2504c7e35e7;hb=d8afd601de1f0d8afe6eff61d40ff52d21d90fd8;hpb=d6f43cecc51a1596669e7f082ec75167a2553555 diff --git a/src/prompt.cpp b/src/prompt.cpp index 5b2e048..493425a 100644 --- a/src/prompt.cpp +++ b/src/prompt.cpp @@ -28,18 +28,17 @@ #include #include -static std::vector contexts; +//////////////////////////////////////////////////////////////////////////////// +static std::vector contexts; std::string composeContexts (bool pretty = false); -//////////////////////////////////////////////////////////////////////////////// int promptClear () { contexts.clear (); return 0; } -//////////////////////////////////////////////////////////////////////////////// int promptRemove () { if (contexts.size ()) @@ -49,6 +48,7 @@ int promptRemove () } //////////////////////////////////////////////////////////////////////////////// + int promptAdd (const std::string& context) { contexts.push_back (context); @@ -56,6 +56,7 @@ int promptAdd (const std::string& context) } //////////////////////////////////////////////////////////////////////////////// + std::string promptCompose () { return "% ";