aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2022-11-18 11:52:14 +0900
committerGitHub <noreply@github.com>2022-11-18 11:52:14 +0900
commitba6f1e662e55654af3f15585b7e1e5b088c13524 (patch)
treeebadfb25b859f37869f4e5d83b3d2ad425faa58c
parentMerge pull request #935 from zsh-users/remove_vagrant (diff)
parentUpdate coffee completion (diff)
downloadzsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar.gz
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar.bz2
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar.lz
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar.xz
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.tar.zst
zsh-completions-ba6f1e662e55654af3f15585b7e1e5b088c13524.zip
Merge pull request #934 from zsh-users/update-coffee
Update coffee completion
-rw-r--r--src/_coffee43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/_coffee b/src/_coffee
index 10b6b81..ebe36e6 100644
--- a/src/_coffee
+++ b/src/_coffee
@@ -1,6 +1,6 @@
#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.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
# Description
# -----------
#
-# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
+# Completion script for Coffee.js v2.7.0 (https://coffeescript.org/)
#
# ------------------------------------------------------------------------------
# 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
-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 -C \
- '(- *)'{-h,--help}'[display this help message]' \
- '(- *)'{-v,--version}'[display the version number]' \
- $opts \
+_arguments -s -S \
+ '--ast[generate an abstract syntax tree of nodes]' \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
+ '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
+ '(- *)'{-h,--help}'[display this help message]' \
'(-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]' \
- '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
- '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
- '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
- '(-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]' \
+ '(-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]' \
'*:script or directory:_files' && ret=0