Consider Inferred Subcommands
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
As of clap v2.21 there is a new setting that allows subcommands to be inferred so long as they're not ambiguous. Since rustup makes heavy use of long strings of subcommands this could greatly increase ergonomics.
For instance the following are equivilant:
$ rustup toolchain update stable
$ rustup to up stable
This also completely sidesteps the, "was it toolchain or toolchains?"
The only change that would be needed in the code is adding a line right after this one with the following:
.global_setting(AppSettings::InferSubcommands)
Thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open src/rustup-cli/rustup_mode.rs at the linked global-settings call and verify the clap v2.21 AppSettings import and behavior. Check that unambiguous abbreviations such as “to up” work for rustup subcommands while ambiguous names remain rejected; the issue is done when this behavior is confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100