clarkperkins / click-shell

An extension to click that easily turns your click app into a shell utility
BSD 3-Clause "New" or "Revised" License
88 stars 17 forks source link

Enabling jumping directly into a subshell and then returning to parent #26

Open pokken-magic opened 3 years ago

pokken-magic commented 3 years ago

I've built a project with subshells, where the parent shell adds another shell as a command. It works almost perfectly. The one unintuitive behavior is that if you jump directly into a subshell, then exit, you leave the command instead of return to the toplevel menu.

Suppose you have command, with subcommand1 and subcommand2 which each have multiple subcommands. If you do, say, 'command subcommand1' it'll drop you into the subcommand1 shell, then when you exit it will return you to the command prompt instead of the command shell as expected.

Adding some control over the behavior of exit/quit would be very cool!