Skip to content

[RRFC] Decompose bash completions #756

Open
@dysbulic

Description

@dysbulic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions