-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Aliases for subcommands #469
Comments
Right now there isn't. If you're on Linux or OSX, shell aliases do exactly that though. |
I know, I thought of something internal though, so you could use one subcommand as a preconfigured shortcut to another. Thor does something similar, there you can |
I can put this on the issue tracker, but there are a few issues in priority over it so it could be a while. I'll have to play with some implementations to see how it works out. I'm not super familiar with Thor so I'll into that too. Thanks! |
Perhaps it's just a documentation thing, it would only by nice to be able to manually construct ArgMatches nicer, but this is not so super important, as it can be abstracted around. Thank you for your consideration though 👏 |
If the alias is known beforehand, you can just route calls for the alias subcommand to the same handler as the other command with arguments. Then also use the |
I've been putting some thought into this, and finally decided on a route to take. I'll add an |
Once #502 merges I'll put out v2.5.0 on crates.io which contains this feature. |
Hi, is there a way to alias subcommands, perhaps even with preset configuration?
I'm thinking of something as simple as making
tool list
equivalent totool ls
,but also something like
tool csv
meaningtool list --tabular --separator ";" --colors off
.This would allow turning certain configurations of a subcommand into their own subcommand.
The text was updated successfully, but these errors were encountered: