Commit graph

8 commits

Author SHA1 Message Date
mmuller
f1219120ea Revert error message escaping to hand written version
It turns out that SourceCodeEscapers has still not been released to github.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196721579
2018-05-17 21:52:35 -04:00
mmuller
25d03f239c Allow "encapsulated output" from the shell command
Since the ConsoleReader now controls the display of the prompt, there is no
longer any way for an external program interacting with the nomulus shell to
recognize when the last command issued has been completed.

To remedy this, we introduce an "--encapsulate_output" flag, which causes
standard output and standard error to be wrapped in a class that precedes
all normal lines of output with a prefix ("out: " or "err: ", accordingly)
and allows the command processor to insert a "SUCCESS" or "FAILURE"
line (with no special prefix) after completing the processing of a
command.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196702338
2018-05-17 21:52:35 -04:00
guyben
bec24a3558 Complete enums on tab
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192451820
2018-04-23 14:25:21 -04:00
guyben
013558c814 Make it VERY clear when nomulus shell is on PROD
We don't want people to accidentally run commands on prod thinking they were on
Alpha / Sandbox.

To do that - we add 2 safeguards:

1) when on prod, the shell has a strong RED "PRODUCTION" in the commandline, while on alpha/sandbox it's green.

2) if a prod shell is idle for > 1h, it exits. So don't accidentally use a prod shell from a long time ago.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191931731
2018-04-10 16:51:42 -04:00
guyben
6d5f7dc4a1 Print documentation for flags
After writing a flag on the shell, pressing "tab" will print out the
documentation for that flag.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191899137
2018-04-10 16:48:33 -04:00
guyben
3338b91c84 Remove the "shell" command from the completions, and allow empty lines
Even though you couldn't run a "shell" inside a "shell", the completion still
assumed you could :(

On the way - fixing error on empty lines: when you just press "enter", the shell should ignore it rather than try to run it as a command (and getting an error, obviously)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191605029
2018-04-10 16:32:12 -04:00
guyben
cfd83ad4dc Add "libreadlines"-like behavior to the shell command
Using the jline open-source library.

We save the history between invocations to ~/.nomulus_history

We add some simple completions:
- first argument completes to command name
- all other arguments complete to the command parameters, or filename

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191501023
2018-04-10 16:22:30 -04:00
mmuller
f1c29633fb Add a "shell" pseudo-command to nomulus tool
Add the "shell" command which lets you run multiple other command in a single
session, sparing you the initialization costs for all but the first of them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188712815
2018-03-19 18:22:01 -04:00