cli
cli copied to clipboard
Alias a command?
I want to add a command quit
that does just what the built-in command exit
does.
Users of my application complain that they get an error when they type quit
!
There's a slight complication with adding a "quit" command that mimics the behavior of "exit." Both "exit" and "help" are currently implemented as global commands, meaning they can be used within any submenu. Unfortunately, the library doesn't currently allow users to define their own global commands.
However, your request does highlight some valuable features that could be explored in the future:
- User-defined Global Commands: This would allow library users to create custom global commands that function across all submenus.
- Command Aliases: Users could define alternative names (aliases) for existing commands, both local and global.
- Customizable Default Commands: This would provide flexibility for users to modify the default strings for commands like "exit," "help," and error messages (see issue #64).