aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar Stefan Maric <alexstefan92@gmail.com>2015-09-07 10:33:09 -0430
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-12 12:12:21 +0200
commit3b5aab6edb0aea3a02383a74479c7afacb0e76f0 (patch)
tree4f8a53e0bdeea441effb728771b7562557ac9f1e /share
parent11c8a47d2289858f5b943dd38daaad028413413d (diff)
Complete list of available scripts for npm run/run-script command
Diffstat (limited to 'share')
-rw-r--r--share/completions/npm.fish9
1 files changed, 9 insertions, 0 deletions
diff --git a/share/completions/npm.fish b/share/completions/npm.fish
index e2f7277e..ac0e264f 100644
--- a/share/completions/npm.fish
+++ b/share/completions/npm.fish
@@ -31,6 +31,11 @@ function __fish_npm_settings
command npm config ls -l | command grep -o '.* =' | command tr -d '; ' | command tr -d ' ='
end
+# return everything that can be used with the npm run command
+function __fish_npm_run
+ command npm run | command grep '^ [^ ]' | command tr -d ' '
+end
+
# cache
complete -f -c npm -n '__fish_npm_needs_command' -a 'cache' -d "Manipulates package's cache"
complete -f -c npm -n '__fish_npm_using_command cache' -a 'add' -d 'Add the specified package to the local cache'
@@ -106,6 +111,10 @@ for c in 'up' 'update'
complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Update global package(s)'
end
+# run
+complete -f -c npm -n "__fish_npm_using_command run" -a '(__fish_npm_run)'
+complete -f -c npm -n "__fish_npm_using_command run-script" -a '(__fish_npm_run)'
+
# misc shorter explanations
complete -f -c npm -n '__fish_npm_needs_command' -a 'adduser add-user login' -d 'Add a registry user account'
complete -f -c npm -n '__fish_npm_needs_command' -a 'bin' -d 'Display npm bin folder'