[RRFC] Decompose `bash` completions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 778
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
The result of running npm completion is a monolithic function for the entirety of the npm command. Contrast this with git which allows a definition like:
alias gp='git push'
__git_complete gp _git_push
How
Current Behaviour
The current npm completion only works for the base command.
Desired Behaviour
I could define:
alias nr='npm run'
__npm_complete nr _npm_run
And when I double tab after nr it would show me the available tasks (the behavior when double tabbing after npm run when completions are loaded) rather than listing the files in the current directory.
References
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
Start by reading the current npm completion behavior and the referenced git Bash completion implementation. Define how a completion function for aliases such as nr='npm run' should be exposed, and consider the work complete when alias commands offer the same subcommand completions as their expanded npm commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100