mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 01:15:55 +03:00
[GH-ISSUE #310] Expose clap's shell completion generation methods via CLI #162
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ed9w2in6 on GitHub (Dec 4, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/310
Who, What, and Why
As a user,
I want shell completion,
so that I do not need to memorise the CLI or rely on the CLI's help utility.
--> This allows a smoother CLI usage experience and potentially further improves CLI discoverability.
Specific scenarios:
spotify_player get key <key>have arguments with specific values. Since they are nicely named but long, completion can speed this up by reducing risk of typo.shell completion: custom TAB-completion available for some shells that requires custom script provided by the CLI program
some shells:
clap_complete 4.4.4providesbash,elvish,fish,powershellandzshHow (roughly)
new dependencies
clap_complete: https://docs.rs/clap_complete/latest/clap_complete/index.htmlclap = "4.4.10"requiresclap_complete, our master branch is atclap = "4.4.10"as of [2023-12-04]implementation directions
generate_toincluded an implementation that generates completions within thebuild.rsscript during build time: https://docs.rs/clap_complete/latest/clap_complete/generator/fn.generate_to.htmlWhen
NOT urgent.
The CLI is already very much usable at the current state.
Other informations
spotify-tuiuses implementation direction 1, but they are usingclap = "2.33.3":github.com/Rigellute/spotify-tui@c4dcf6b9fd/src/main.rs (L171-L185)clap = "2.33.3"BUT it seems to be fixed since (clap = "4.3.11",clap_complete = "4.3.2"): https://github.com/clap-rs/clap/issues/1822spotify_playerinstead ofspotify-playerin documents #646spotify_playerinstead ofspotify-playerin documents #1582