Skip to content

Commit

Permalink
docs: bash_completion.d dir found in /etc not /usr/local (#72)
Browse files Browse the repository at this point in the history
I found this page useful for setting up npm command completion. Thank you npm 
documentation team.

This suggested changed is based on my system which runs Ubuntu where
the completion directory path for bash is found in 
/etc/bash_completion.d and not /usr/local/etc/bash_completion.d

I dug around docs for this in The Bash Manual 
https://www.gnu.org/software/bash/manual/bashref.html#Programmable-Completion 
and on some an old (sadly retired) Debian Admin Site
https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2

which seemed supportive of the dir being in /etc but I do not have access 
to an OS X machine where I guess bash_completion.d could be in /usr/local/etc 
so I left it in.

PR-URL: #72
Credit: @RobertKielty
Reviewed-By: @zkat
  • Loading branch information
RobertKielty authored and zkat committed Nov 26, 2018
1 parent 27217da commit 15da826
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/cli/npm-completion.md
Expand Up @@ -17,9 +17,10 @@ everywhere:
npm completion >> ~/.bashrc
npm completion >> ~/.zshrc

You may of course also pipe the output of npm completion to a file
such as `/usr/local/etc/bash_completion.d/npm` if you have a system
that will read that file for you.
You may of course also pipe the output of `npm completion` to a file
such as `/usr/local/etc/bash_completion.d/npm` or
`/etc/bash_completion.d/npm` if you have a system that will read
that file for you.

When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the
environment, `npm completion` acts in "plumbing mode", and outputs
Expand Down

0 comments on commit 15da826

Please sign in to comment.