Compare commits

...

6 Commits

Author SHA1 Message Date
Alexander F. Rødseth 11edcd3ccd
Merge 4f793a0031 into d08cee09ce 2025-09-20 17:35:27 -03:00
Shohei YOSHIDA d08cee09ce
Merge pull request #1152 from notmike-5/master
src/_bitcoin-cli: refresh argument/subcommand lists that had become stale
2025-09-14 14:13:53 +09:00
Shohei YOSHIDA 058383dc2d
Fix argument parameters 2025-09-14 12:46:00 +09:00
notmike d3d42e70ec src/_bitcoin-cli: updated flags for arguments/defaults 2025-09-13 16:22:51 -06:00
notmike 07ad869b7a src/_bitcoin-cli: refresh option/subcommand lists that had become stale 2025-09-10 16:15:03 -06:00
Alexander F. Rødseth 4f793a0031 Add completions for sox 2024-09-15 16:09:31 +02:00
5 changed files with 230 additions and 331 deletions

View File

@ -28,14 +28,14 @@
# Description
# -----------
#
# Completion script for bitcoin-cli (https://bitcoin.org).
# Completion script for bitcoin-cli v29.0.0 (https://bitcoin.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ian Ker-Seymer (https://github.com/ianks)
# * notmike
# * notmike (https://github.com/notmike-5)
# ------------------------------------------------------------------------------
_bitcoin-cli() {
@ -43,21 +43,24 @@ _bitcoin-cli() {
_arguments -C \
-?'[This help message]' \
-addrinfo'[Get the number of addresses known to the node, per network and total, after filtering for quality and recency. Total number of addresses known to the node may be higher.]' \
-addrinfo'[Get the number of addresses known to the node, per network and total]' \
-chain='[Use the chain <chain> (default: main). Allowed values: main, test, signet, regtest]:chain:(main test signet regtest)' \
-color='[Color setting for CLI output (default: auto). Valid values: always, auto, never]:when:(always auto never)' \
-color='[Color setting for CLI output (default: auto)]:when:(always auto never)' \
-conf='[Specify configuration file. Relative paths will be prefixed by datadir location. (default: bitcoin.conf)]:PATH:_files' \
-datadir='[Specify data directory]:PATH:_directories' \
-getinfo='[Get general information from the remote server.]' \
-getinfo'[Get general information from the remote server]' \
-testnet'[Use the test chain]' \
-regtest'[Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \
-regtest'[Enter regression test mode]' \
-named'[Pass named instead of positional arguments (default: false)]' \
-netinfo=-'[Get network peer connection information from the remote server.]::level_or_help:(0 1 2 3 4 help)' \
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases)]' \
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D]' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8332, testnet: 18332, regtest: 18443)]: :_guard "[[\:digit\:]]#" "PORT"' \
-rpcwait'[Wait for RPC server to start]' \
-rpcwaittimeout='[Timeout in seconds to wait for the RPC server to start, or 0 for no timeout. (default: 0)]:timeout' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
-rpccookiefile='[Location of the auth cookie(default: data dir)]:dir:_files' \
-rpcwallet='[Send RPC for non-default wallet on RPC server]:server' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
-rpcclienttimeout='[Timeout during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
-version'[Print version and exit]' \
@ -66,6 +69,7 @@ _bitcoin-cli() {
case $state in
subcommand)
subcommands=(
'dumptxoutset'
'getbestblockhash'
'getblock'
'getblockchaininfo'
@ -75,6 +79,7 @@ _bitcoin-cli() {
'getblockhash'
'getblockheader'
'getblockstats'
'getchainstates'
'getchaintips'
'getchaintxstats'
'getdeploymentinfo'
@ -88,9 +93,12 @@ _bitcoin-cli() {
'gettxoutproof'
'gettxoutsetinfo'
'gettxspendingprevout'
'importmempool'
'loadtxoutset'
'preciousblock'
'pruneblockchain'
'savemempool'
'scanblocks'
'scantxoutset'
'verifychain'
'verifytxoutproof'
@ -103,6 +111,7 @@ _bitcoin-cli() {
'getblocktemplate'
'getmininginfo'
'getnetworkhashps'
'getprioritisedtransactions'
'prioritisetransaction'
'submitblock'
'submitheader'
@ -110,6 +119,7 @@ _bitcoin-cli() {
'clearbanned'
'disconnectnode'
'getaddednodeinfo'
'getaddrmaninfo'
'getconnectioncount'
'getnettotals'
'getnetworkinfo'
@ -128,12 +138,14 @@ _bitcoin-cli() {
'decodepsbt'
'decoderawtransaction'
'decodescript'
'descriptorprocesspsbt'
'finalizepsbt'
'fundrawtransaction'
'getrawtransaction'
'joinpsbts'
'sendrawtransaction'
'signrawtransactionwithkey'
'submitpackage'
'testmempoolaccept'
'utxoupdatepsbt'
'enumeratesigners'
@ -141,22 +153,22 @@ _bitcoin-cli() {
'deriveaddresses'
'estimatesmartfee'
'getdescriptorinfo'
'getindexinfo'
'signmessagewithprivkey'
'validateaddress'
'verifymessage'
'abandontransaction'
'abortrescan'
'addmultisigaddress'
'backupwallet'
'bumpfee'
'createwallet'
'dumpprivkey'
'dumpwallet'
'createwalletdescriptor'
'encryptwallet'
'getaddressesbylabel'
'getaddressinfo'
'getbalance'
'getbalances'
'gethdkeys'
'getnewaddress'
'getrawchangeaddress'
'getreceivedbyaddress'
@ -164,13 +176,8 @@ _bitcoin-cli() {
'gettransaction'
'getunconfirmedbalance'
'getwalletinfo'
'importaddress'
'importdescriptors'
'importmulti'
'importprivkey'
'importprunedfunds'
'importpubkey'
'importwallet'
'keypoolrefill'
'listaddressgroupings'
'listdescriptors'
@ -186,7 +193,6 @@ _bitcoin-cli() {
'loadwallet'
'lockunspent'
'migratewallet'
'newkeypool'
'psbtbumpfee'
'removeprunedfunds'
'rescanblockchain'
@ -195,7 +201,6 @@ _bitcoin-cli() {
'sendall'
'sendmany'
'sendtoaddress'
'sethdseed'
'setlabel'
'settxfee'
'setwalletflag'

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