Open kmikaz51 opened 4 years ago
Had the same issue and I ended up spawning another shell inside the shell...
@cli.group(invoke_without_command=True)
@click.pass_context
def test(ctx):
if ctx.invoked_subcommand is None:
subshell = make_click_shell(ctx, prompt='subshell >> ')
subshell.cmdloop()
@test.command()
def test1():
print("Test1")
@test.command()
def test2():
print("Test2")
Thank you a lot.
Do you know if it is possible to change the prompt when the shell is running ?
If you pass a callable that takes in a context as the prompt
when using make_click_shell
, I believe you can have it return a different string based on values in the click context.
Hello,
I am interested in making a shell with subshells but I can't find a way of doing it with your lib.
Do you know if it is possible ?
Regards,