Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias a command? #228

Open
pkbehera opened this issue Mar 15, 2024 · 1 comment
Open

Alias a command? #228

pkbehera opened this issue Mar 15, 2024 · 1 comment

Comments

@pkbehera
Copy link

pkbehera commented Mar 15, 2024

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!

@pkbehera pkbehera changed the title Can I alias a command? Alias a command? Mar 15, 2024
@daniele77 daniele77 self-assigned this Mar 26, 2024
@daniele77
Copy link
Owner

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 Customizable messages #64).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants