Skip to content

Commit

Permalink
Update nvm help messages and autocomplete help
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebucaran committed Apr 30, 2023
1 parent 9ca2967 commit 2efc240
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
10 changes: 5 additions & 5 deletions completions/nvm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ complete --command nvm --exclusive --long help --description "Print help"
complete --command nvm --long silent --description "Suppress standard output"

complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
test -e $nvm_data && string split ' ' <$nvm_data/.index
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
_nvm_list | string split ' ' | string replace system ''
)"
Expand Down
31 changes: 18 additions & 13 deletions functions/nvm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,28 @@ function nvm --description "Node version manager"
echo "nvm, version 2.2.12"
case "" -h --help
echo "Usage: nvm install <version> Download and activate the specified Node version"
echo " nvm install Install version from nearest .nvmrc file"
echo " nvm use <version> Activate a version in the current shell"
echo " nvm use Activate version from nearest .nvmrc file"
echo " nvm list List installed versions"
echo " nvm list-remote List versions available to install"
echo " nvm list-remote <regex> List versions matching a given regular expression"
echo " nvm current Print the currently-active version"
echo " nvm uninstall <version> Uninstall a version"
echo " nvm install Install the version specified in the nearest .nvmrc file"
echo " nvm use <version> Activate the specified Node version in the current shell"
echo " nvm use Activate the version specified in the nearest .nvmrc file"
echo " nvm list List installed Node versions"
echo " nvm list-remote List available Node versions to install"
echo " nvm list-remote <regex> List Node versions matching a given regex pattern"
echo " nvm current Print the currently-active Node version"
echo " nvm uninstall <version> Uninstall the specified Node version"
echo "Options:"
echo " -s or --silent Suppress standard output"
echo " -v or --version Print version"
echo " -h or --help Print this help message"
echo " -s, --silent Suppress standard output"
echo " -v, --version Print the version of nvm"
echo " -h, --help Print this help message"
echo "Variables:"
echo " nvm_arch Override architecture, e.g. x64-musl"
echo " nvm_mirror Use a mirror of the Node binaries"
echo " nvm_mirror Use a mirror for downloading Node binaries"
echo " nvm_default_version Set the default version for new shells"
echo " nvm_default_packages Install a list of packages every time you install a Node version"
echo " nvm_default_packages Install a list of packages every time a Node version is installed"
echo "Examples:"
echo " nvm install latest Install the latest version of Node"
echo " nvm use 14.15.1 Use Node version 14.15.1"
echo " nvm use system Activate the system's Node version"

case install
_nvm_index_update

Expand Down

0 comments on commit 2efc240

Please sign in to comment.