From 0536cda7568fb551a3c864eb81f7f20577e8466c Mon Sep 17 00:00:00 2001 From: Robert Kielty Date: Mon, 24 Sep 2018 10:30:16 +0100 Subject: [PATCH] bash_completion.d dir found in /etc not /usr/local 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. --- doc/cli/npm-completion.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/cli/npm-completion.md b/doc/cli/npm-completion.md index cc826a4d7b6d4..57fa3bbd38ce0 100644 --- a/doc/cli/npm-completion.md +++ b/doc/cli/npm-completion.md @@ -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