Merge pull request #934 from zsh-users/update-coffee
Update coffee completion
This commit is contained in:
commit
ba6f1e662e
45
src/_coffee
45
src/_coffee
|
@ -1,6 +1,6 @@
|
||||||
#compdef coffee
|
#compdef coffee
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
|
# Completion script for Coffee.js v2.7.0 (https://coffeescript.org/)
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
|
@ -39,34 +39,29 @@
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
local curcontext="$curcontext" state line ret=1 version opts first second third
|
local curcontext="$curcontext" state line ret=1
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
version=(${(f)"$(_call_program version $words[1] --version)"})
|
|
||||||
version=${${(z)${version[1]}}[3]}
|
|
||||||
first=$(echo $version|cut -d '.' -f 1)
|
|
||||||
second=$(echo $version|cut -d '.' -f 2)
|
|
||||||
third=$(echo $version|cut -d '.' -f 3)
|
|
||||||
if (( $first < 2 )) && (( $second < 7 )) && (( $third < 3 ));then
|
|
||||||
opts+=('(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]'
|
|
||||||
'(-r --require)'{-r,--require}'[require a library before executing your script]:library')
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
_arguments -s -S \
|
||||||
_arguments -C \
|
'--ast[generate an abstract syntax tree of nodes]' \
|
||||||
'(- *)'{-h,--help}'[display this help message]' \
|
|
||||||
'(- *)'{-v,--version}'[display the version number]' \
|
|
||||||
$opts \
|
|
||||||
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
|
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
|
||||||
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
|
|
||||||
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
|
|
||||||
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
|
|
||||||
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
|
|
||||||
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
|
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
|
||||||
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
|
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
|
||||||
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
|
'(- *)'{-h,--help}'[display this help message]' \
|
||||||
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
|
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
|
||||||
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
|
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]: :_files -g "*.coffee"' \
|
||||||
|
'(-l --literate)'{-l,--literate}'[treat stdio as literate style coffeescript]' \
|
||||||
|
'(-m --map)'{-m,--map}'[generate source map and save as .js.map files]' \
|
||||||
|
'(-M --inline-map)'{-M,--inline-map}'[generate source map and include it directly in output]' \
|
||||||
|
'(-n --nodes)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
|
||||||
|
'--nodejs[pass options directly to the "node" binary]' \
|
||||||
|
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]: :_files' \
|
||||||
|
'(-p --print --tokens)'{-p,--print}'[print out the compiled JavaScript]' \
|
||||||
|
'(-r --require)'\*{-r,--require}'[require the given module before eval or REPL]:module' \
|
||||||
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
|
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
|
||||||
|
'(-t --transpile)'{-t,--transpile}'[pipe generated JavaScript through Babel]' \
|
||||||
|
'(-p --print --tokens)--tokens[print out the tokens that the lexer/rewriter produce]' \
|
||||||
|
'(- *)'{-v,--version}'[display the version number]' \
|
||||||
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
|
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
|
||||||
'*:script or directory:_files' && ret=0
|
'*:script or directory:_files' && ret=0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue