abiosoft / ishell

Library for creating interactive cli applications.
MIT License
1.68k stars 195 forks source link

Subshell or previous context save #141

Open vit1251 opened 3 years ago

vit1251 commented 3 years ago

Example usage:

>>> show
show>>> tables
show / tables >>> ..
show >>> ..
>>> quit
mike-pittelko commented 3 years ago

I'd like to be able to do this as well. if entering a subcommand leave the context there, don't return to the top level context. I suspect this needs to be a new AddCmdFolder or a flag in the cmdcontext marking this as desirable behaviour to keep from breaking the existing behaviour.

 >>> help
 a
 b
 c
 >>> a
 does "a" something
 >>> c
 changes context and stays in "c". Prompt preceded by name of current context.
 c >>>  help
 d
 e
 ..
 c >>> e
 does "e" something, does not execute a + e Func, only "e" func.
 c >>>  ..
 >>> help
 a
 b
 c