So you've build a fantastic node.js CLI, and even took the effort of adding bash
or zsh
completion files! However, now you're telling your users to add the sourcing of this file to their .profile
, or similair intialization script..
No need! Simply add:
npm install shell-completion --save
And in your package.json
use shell-completion
to install the completion files:
{ "scripts": {
"postinstall": "install-completion bash myBashCompletion && install-completion zsh myZshCompletion"
} }
Shell-completion will link your completion files to the specified shell's and platform's default location.
A pull request for Powershell support would be very welcome! Should be trivial for someone familiar with the platform
- Supports Bash and Zsh
- Supports Homebrew installation prefixes on OS X
- Logs all errors if anything fails, but always exits without an error code. This means adding
install-completion
to yourpostinstall
is completely safe, and will never break the rest of your application's installation!
Usage: link [options] [command]
Commands:
bash <completionfile> Link <completionfile> for usage in bash
zsh <completionfile> Link <completionfile> for usage in zshell
Options:
-h, --help output usage information
-V, --version output the version number