Compare commits

...

6 Commits

Author SHA1 Message Date
Alexander F. Rødseth df7b905fc4
Merge 4f793a0031 into 0adf2f053e 2025-02-15 04:32:08 +00:00
Shohei YOSHIDA 0adf2f053e
Merge pull request #1123 from zsh-users/update_node
Update node completion to version 23.8.0
2025-02-14 12:08:32 +09:00
Shohei YOSHIDA b84082e664
Update node completion to version 23.8.0 2025-02-14 12:06:51 +09:00
Shohei YOSHIDA 7f0a0c4451
Merge pull request #1122 from zsh-users/update-go-1.24.0
Update go completion to version 1.24.0
2025-02-13 15:27:34 +09:00
Shohei YOSHIDA f9c7cbe31f
Update go completion to version 1.24.0 2025-02-12 17:11:41 +09:00
Alexander F. Rødseth 4f793a0031 Add completions for sox 2024-09-15 16:09:31 +02:00
6 changed files with 91 additions and 190 deletions

View File

@ -30,7 +30,7 @@
# Description
# -----------
#
# Completion script for go 1.23.0 (https://go.dev/).
# Completion script for go 1.24.0 (https://go.dev/).
#
# ------------------------------------------------------------------------------
# Authors
@ -81,7 +81,7 @@ __go_runtimedebug() {
'tracebackancestors[set ancestor goroutines to be printed in goroutine creation stacks]:int'
'asyncpreemptoff[disable signal-based asynchronous goroutine preemption.]:boolean:(1 0)'
)
_values -s ',' -S '=' "runtime debug behaviour" $vars[@]
_values -s ',' -S '=' "runtime debug behavior" $vars[@]
}
__go_gcdebugflags() {
@ -102,7 +102,7 @@ __go_gcdebugflags() {
'export[print export data]' \
'pctab[print named pc-value table]:pc-value:(pctospadj pctofile pctoline pctoinline pctopcdata)' \
'locationlists[print information about DWARF location list creation]' \
'typecheckinl[eager typechecking of inline function bodies]' \
'typecheckinl[eager type-checking of inline function bodies]' \
'dwarfinl[print information about DWARF inlined function creation]' \
'softfloat[force compiler to emit soft-float code]' \
'defer[print information about defer compilation]' \
@ -214,7 +214,7 @@ __go_envvarvals() {
_values "module mode" off on auto
;;
# commands
(AR|CC|CXX|FC|GCCGO)
(AR|CC|CXX|FC|GCCGO|GOAUTH|GOCACHEPROG)
_command_names -e
;;
# directories
@ -288,6 +288,9 @@ __go_envvarvals() {
(GOSUMDB)
_message "e.g. sum.golang.org+<publickey> https://sum.golang.org"
;;
(GOFIPS140)
_values 'FIPS version' off latest
;;
esac
}
@ -312,7 +315,7 @@ __go_packages() {
__go_fix_names() {
local -a fix_names=(
'buildtag[remove +build comments from modules using Go 1.18 or later]'
'cftype[fixes initialzers and casts of C.*Ref and JNI types]'
'cftype[fixes initializers and casts of C.*Ref and JNI types]'
'context[Change imports of golang.org/x/net/context to context]'
'egl[fixes initializers of EGLDisplay]'
'eglconf[fixes initializers of EGLConfig]'
@ -401,6 +404,7 @@ case $state in
(build)
_arguments \
'-o[force build to write to named output file or directory]:file or directory:_files' \
'-json[emit build output in JSON suitable for automated processing]' \
${build_flags[@]} \
${mod_flags[@]} \
'*:importpaths:__go_packages'
@ -436,11 +440,14 @@ case $state in
"GO111MODULE[controls whether the go command runs in module-aware mode]:value"
"GCCGO[gccgo command to run.]:gccgo command"
"GOARCH[architecture, or processor, for which to compile code.]:architecture"
"GOAUTH[controls authentication for go-import and HTTPS module mirror interactions]:command"
"GOBIN[directory where 'go install' installs to]:go install target dir"
"GOCACHE[directory to store cached information]:go build cache dir"
"GOCACHEPROG[a command that implements an external go build cache]:command"
"GOMODCACHE[module cache directory]:path"
"GODEBUG[enable runtime debug facilities]:runtime debug settings"
"GOENV[location of the go environment configuration file]:configuration file"
"GOFIPS140[the FIPS-140 cryptography mode to use when building binaries]"
"GOFLAGS[default go command line flags]:space separated default command line flags"
"GOINSECURE[module prefixes that are fetched insecurely]:comma separated module prefixes"
"GOOS[target operating system]:operating system"
@ -554,18 +561,17 @@ case $state in
(get)
# no mod_flags for get
_arguments \
'-d[instructs get to stop after downloading the packages]' \
'-f[force get -u not to verify that each package has been checked from vcs]' \
'-fix[run the fix tool on the downloaded packages]' \
'-insecure[permit fetching/resolving custom domains]' \
'-t[also download the packages required to build tests]' \
'-u[use the network to update the named packages]' \
'-tool[instructs go to add a matching tool line to go.mod for each listed package]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
(install)
_arguments ${build_flags[@]} \
_arguments \
${build_flags[@]} \
'-json[emit install output in JSON suitable for automated processing]' \
'*:importpaths:__go_packages'
;;
@ -928,8 +934,8 @@ case $state in
'-buildid[record id as Go toolchain build id]:id' \
'-buildmode[set build mode]:mode' \
'-c[dump call graph]' \
'-capturehostobjs[capture host object files loading duraing internal linking to specified dir]:dir:_path_files -/' \
'-checklinkname[check linkname symbol references]' \
'-capturehostobjs[capture host object files loading during internal linking to specified dir]:dir:_path_files -/' \
'-checklinkname[check link-name symbol references]' \
'-compressdwarf[compress DWARF if possible]' \
'-cpuprofile[write cpu profile to file]:file:_files' \
'-d[disable dynamic executable]' \

View File

@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for Node.js v23.6.0 (https://nodejs.org)
# Completion script for Node.js v23.8.0 (https://nodejs.org)
#
# ------------------------------------------------------------------------------
# Authors
@ -224,6 +224,7 @@ _arguments -C \
'--use-bundled-ca[use bundled CA store (default)]' \
'--use-largepages=[re-map the Node.js static code to large memory pages at startup]:mode:(off on silent)' \
"--use-openssl-ca[use OpenSSL's default CA store]" \
"--use-system-ca[Use system's CA store]" \
'(- 1 *)--v8-options[print v8 command line options]' \
"--v8-pool-size=[set v8's thread pool size]:number" \
"--watch[run in watch mode]" \

185
src/_play
View File

@ -1,190 +1,21 @@
#compdef play
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the play command (from SoX)
# (http://sox.sourceforge.net/)
#
# Completion script for Play! framework 1.2.2 (https://www.playframework.com/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
# * Mario Fernandez (https://github.com/sirech)
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_play() {
local context curcontext="$curcontext" state line
typeset -A opt_args
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
local ret=1
_arguments -C \
'1: :_play_cmds' \
'*::arg:->args' \
&& ret=0
case $state in
(args)
curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
case $line[1] in
(build-module|list-modules|lm|check|id)
_message 'no more arguments' && ret=0
;;
(dependencies|deps)
_arguments \
'1:: :_play_apps' \
'(--debug)--debug[Debug mode (even more information logged than in verbose mode)]' \
'(--jpda)--jpda[Listen for JPDA connection. The process will be suspended until a client is plugged to the JPDA port.]' \
'(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknown dependencies.]' \
'(--verbose)--verbose[Verbose Mode]' \
&& ret=0
;;
(clean|javadoc|jd|out|pid|secret|stop)
_arguments '1:: :_play_apps' && ret=0
;;
(help)
_arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
;;
(status|st)
_arguments \
'1:: :_play_apps' \
'(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
'(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
&& ret=0
;;
(new)
_arguments \
'1: :_play_apps' \
'(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
&& ret=0
;;
(install)
_arguments '1:Play! module:_play_modules_dash_versions' && ret=0
;;
(new-module)
_arguments '1:Module directory:_files -/' && ret=0
;;
(test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
local cmd_args; cmd_args=(
'1:: :_play_apps'
'(--deps)--deps[Resolve and install dependencies before running the command]'
)
case $line[1] in
(precompile|run|start|restart|war)
local app_dir="$line[2]"
[[ -d "$app_dir" ]] || app_dir=.
[[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
;|
(test|run)
cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
;|
(war)
cmd_args+=(
'(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
'(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
'(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
)
;|
(test|run|start|restart|war)
cmd_args+=('*:Java option')
;;
esac
_arguments "$cmd_args[@]" && ret=0
;;
*)
_call_function ret _play_cmd_$words[1] && ret=0
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
}
# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
(( $+functions[_play_cmds] )) ||
_play_cmds() {
local commands; commands=(
'antify:Create a build.xml file for this project'
'auto-test:Automatically run all application tests'
'build-module:Build and package a module'
'check:Check for a release newer than the current one'
{classpath,cp}':Display the computed classpath'
'clean:Delete temporary files (including the bytecode cache)'
{dependencies,deps}':Resolve and retrieve project dependencies'
{eclipsify,ec}':Create all Eclipse configuration files'
'evolutions:Run the evolution check'
'evolutions\:apply:Automatically apply pending evolutions'
'evolutions\:mark:AppliedMark pending evolutions as manually applied'
'evolutions\:resolve:Resolve partially applied evolution'
'help:Display help on a specific command'
'id:Define the framework ID'
{idealize,idea}':Create all IntelliJ Idea configuration files'
'install:Install a module'
{javadoc,jd}':Generate your application Javadoc'
{list-modules,lm}':List modules available from the central modules repository'
'modules:Display the computed modules list'
{netbeansify,nb}':Create all NetBeans configuration files'
'new:Create a new application'
{new-module,nm}':Create a module'
'out:Follow logs/system.out file'
'pid:Show the PID of the running application'
'precompile:Precompile all Java sources and templates to speed up application start-up'
'restart:Restart the running application'
'run:Run the application in the current shell'
'secret:Generate a new secret key'
'start:Start the application in the background'
{status,st}':Display the running application status'
'stop:Stop the running application'
'test:Run the application in test mode in the current shell'
'war:Export the application as a standalone WAR archive'
)
_describe -t commands 'Play! command' commands "$@"
}
(( $+functions[_play_apps] )) ||
_play_apps() {
_wanted application expl 'Play! application directory' _files -/
}
(( $+functions[_play_modules] )) ||
_play_modules() {
local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
_describe -t modules 'Play! module' modules "$@"
}
(( $+functions[_play_modules_dash_versions] )) ||
_play_modules_dash_versions() {
local ret=1
if compset -P '*-'; then
local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
_describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
else
_wanted modules expl 'Play! module' _play_modules -qS- && ret=0
fi
}
(( $+functions[_play_modules_list] )) ||
_play_modules_list() {
compset -P '*,'; compset -S ',*'
_wanted module-list expl 'Play! modules list' _play_modules -qS,
}
(( $+functions[_play_colon_dirs_list] )) ||
_play_colon_dirs_list() {
compset -P '*:'; compset -S ':*'
_wanted directories-list expl 'Directories list' _files -/ -qS:
}
_play "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et
return ret

21
src/_rec Normal file
View File

@ -0,0 +1,21 @@
#compdef rec
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the rec command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret

21
src/_sox Normal file
View File

@ -0,0 +1,21 @@
#compdef sox
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the sox command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-G --guard)'{-G,--guard}'[use temporary files to guard against clipping]' '(-m --combine=)'{-m,--combine=}'[combine input files]:method:(mix merge concatenate)' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-b --bits=)'{-b,--bits=}'[set encoded sample size in bits]:bits' '(-e --encoding=)'{-e,--encoding=}'[set encoding]:encoding:(signed-integer unsigned-integer floating-point mu-law a-law)' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret

21
src/_soxi Normal file
View File

@ -0,0 +1,21 @@
#compdef soxi
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the soxi command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret