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

cli: (sub)command aliases #2665

Open
dgw opened this issue Mar 8, 2025 · 0 comments
Open

cli: (sub)command aliases #2665

dgw opened this issue Mar 8, 2025 · 0 comments
Labels
Feature Needs Triage Issues that need to be reviewed and categorized

Comments

@dgw
Copy link
Member

dgw commented Mar 8, 2025

Requested Feature

Sometimes I find myself wishing that there was a more concise way to express Sopel CLI actions, e.g. sopel-plugins e pluginname.

Problems Solved

It just saves typing. I thought of this idea (again) while messing with my bot over ssh from a smartphone.

Alternatives

I thought of having subcommands support stemming—any unambiguous sequence that doesn't overlap with another subcommand—but as far as I can tell argparse doesn't support it. (There is allow_abbrev for long option names, but it doesn't apply to subparsers/subcommands.)

Notes

There is an aliases kwarg to add_parser() in argparse, which would let us define shorter aliases for subcommands.

I haven't looked at top-level command aliases yet, but maybe those would be better left to users' shell config (we could provide a sample bashrc etc. snippet).

@dgw dgw added Feature Needs Triage Issues that need to be reviewed and categorized labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Needs Triage Issues that need to be reviewed and categorized
Projects
None yet
Development

No branches or pull requests

1 participant