Revise deprecated bash completion instructions for Linux #2577
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per the FAQ, I revised the instructions for bash completions on Linux, as
/etc/bash_completion.dhas been considered deprecated for a number of years and it's usage is not recommended by the upstream. I didn't change the Mac instruction line, because I do not own a Mac and cannot verify that.All that being said; According to the FAQ the best way to actually get the path to the completions directory is to use
pkg-config --variable completionsdir bash-completion, though I can't say with any certainty how many users may have have the pkg-config file for bash-completion installed, that might be something distributions like Fedora and Debian would have in a-dev/-develpackage. The instructions for a normal user to install them locally are to put them in$XDG_DATA_HOME(default~/.local/share) in a subdirectorybash-completion/completions/<name>, but I guess that would be something at your discretion (maybe a bit too wordy, etc). But if you do want to use the user-level instructions (which should be portable to Macos, as long as$HOMEexists), here is a simple one-line shell command for that, using install since it will create the parent directories: