From 3ce9d453ae7a0e705d81a580eae7f50f84ff66dc Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 4 Aug 2024 14:17:57 +0900 Subject: [PATCH 1/5] Update ccache completion --- src/_ccache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_ccache b/src/_ccache index 72d619d..c1ac0e3 100644 --- a/src/_ccache +++ b/src/_ccache @@ -325,6 +325,8 @@ elif [[ $words[2] == -* ]]; then '--trim-dir[remove old files from directory _PATH_]: :_files -/' \ '--trim-max-size[specify the maximum size for --trim-dir]:size' \ '--trim-method[specify the method for --trim-dir]: :(atime mtime)' \ + '--trim-recompress[recompress to level LEVEL]:level' \ + '--trim-recompress-threads[use up to THREADS threads when recompressing]:threads' \ '--checksum-file[print the checksum of the file at PATH]: :_files' \ '--extract-result[extract file data stored in result file at PATH to the current working directory]' \ '(-k --get-config)'{-k,--get-config}'[print the value of configuration key]:key' \ From 8abb801db2264869d1deb373d33c4a23d1d90d1b Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 4 Aug 2024 14:18:12 +0900 Subject: [PATCH 2/5] Update clang-tidy completion --- src/_clang-tidy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_clang-tidy b/src/_clang-tidy index eead4be..6cca6c9 100644 --- a/src/_clang-tidy +++ b/src/_clang-tidy @@ -46,6 +46,7 @@ _arguments \ '--config-file=[Specify the path of .clang-tidy or custom config-file]: :_files' \ '--dump-config[Dumps configuration in the YAML format to stdout]' \ '--enable-check-profile[Enable per-check timing profiles, and print a report to stderr]' \ + '--enable-module-headers-parsing[Enable preprocessor-level module header parsing for C++20 and above]' \ '--explain-config[For each enabled check explains, where it is enabled]' \ '--export-fixes=[YAML file to store suggested fixes in]: :_files' \ '*--extra-arg[Additional argument to append to the compiler command line]:arg' \ @@ -55,6 +56,7 @@ _arguments \ '--fix-notes[If a warning has no fix, but a single fix can be found through an associated diagnostic node, apply the fix]' \ '--format-style=[Style for formatting code around applied fixes]: :(llvm google webkit mozilla)' \ '--header-filter=[Regular expression matching the names of the headers to output diagnostics from]:regexp' \ + '--line-filter=[List of files with line ranges to filter the warnings]' \ '(- *)--list-checks[List all enabled checks and exit]' \ '--load=[Load the specified plugin]: :_files' \ '-p[Build directory where compile_commands.json is]: :_files -/' \ From 4dfb7a51c5ae9fa61ff0cbe94538d49676687484 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 4 Aug 2024 14:19:29 +0900 Subject: [PATCH 3/5] Cleanup code --- src/_console | 40 +++++++------ src/_cppcheck | 5 +- src/_dad | 47 +++++++++------- src/_gist | 8 +-- src/_optirun | 41 ++++++-------- src/_ralio | 147 +++++++++++++++++++++++------------------------- src/_redis-cli | 14 +---- src/_rmlint | 8 +++ src/_shellcheck | 2 +- src/_wemux | 11 +++- src/_xsel | 14 ++++- 11 files changed, 174 insertions(+), 163 deletions(-) diff --git a/src/_console b/src/_console index 2d11e43..3ed8dd7 100644 --- a/src/_console +++ b/src/_console @@ -35,30 +35,38 @@ # ------- # # * loranger (https://github.com/loranger) -# * Yohan Tambè (https://github.com/Cronos87) +# * Yohan Tamb (https://github.com/Cronos87) # # ------------------------------------------------------------------------------ -_find_console () { - echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)" +_console_find_console() { + echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)" } -_console_get_command_list () { - IFS=" " - `_find_console` --no-ansi | \ - sed "1,/Available commands/d" | \ - awk '/ [a-z]+/ { print $0 }' | \ - sed -E 's/^[ ]+//g' | \ - sed -E 's/[:]+/\\:/g' | \ - sed -E 's/[ ]{2,}/\:/g' +_console_get_command_list() { + IFS=" " + `_console_find_console` --no-ansi | \ + sed "1,/Available commands/d" | \ + awk '/ [a-z]+/ { print $0 }' | \ + sed -E 's/^[ ]+//g' | \ + sed -E 's/[:]+/\\:/g' | \ + sed -E 's/[ ]{2,}/\:/g' } -_console () { - local -a commands - IFS=$'\n' - commands=(`_console_get_command_list`) - _describe 'commands' commands +_console() { + local -a commands + IFS=$'\n' + commands=(`_console_get_command_list`) + _describe 'commands' commands } compdef _console php console compdef _console console + +# 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 diff --git a/src/_cppcheck b/src/_cppcheck index e8ab3fe..859f656 100644 --- a/src/_cppcheck +++ b/src/_cppcheck @@ -49,12 +49,9 @@ _cppcheck_files() { } _cppcheck() { - local curcontext="$curcontext" state line - typeset -A opt_args - local check_ids='(all warning style performance portability information unusedFunction missingInclude)' - _arguments -C \ + _arguments \ "--addon=[Execute addon]" \ "--addon-python=[Specify the python interpreter]: :_files" \ "--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \ diff --git a/src/_dad b/src/_dad index 40d523c..f925377 100644 --- a/src/_dad +++ b/src/_dad @@ -39,30 +39,37 @@ # ------------------------------------------------------------------------------ _dad() { - local -a commands + typeset -A opt_args + local context state line + local curcontext="$curcontext" - commands=( - "start:Start aria2c daemon" - "stop:Stop aria2c daemon" - ) + local -a commands=( + "start:Start aria2c daemon" + "stop:Stop aria2c daemon" + ) - _arguments -C \ - '(- 1 *)'-h"[Show help and exit]" \ - "-d[Set download dir]:download_dir:->val" \ - "-s[Set secret token]:secret_token:->val" \ - "-u[Set aria2c username]:username:->val" \ - "-p[Set aria2c password]:password:->val" \ - '1:cmd:->cmds' \ - '*: : :->args' \ + _arguments -C \ + '(- 1 *)'-h"[Show help and exit]" \ + "-d[Set download dir]:download_dir:->val" \ + "-s[Set secret token]:secret_token:->val" \ + "-u[Set aria2c username]:username:->val" \ + "-p[Set aria2c password]:password:->val" \ + '1:cmd:->cmds' \ + '*: : :->args' - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (*) - ;; - esac + case "$state" in + (cmds) + _describe -t commands 'commands' commands + ;; + esac } _dad +# 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 diff --git a/src/_gist b/src/_gist index 1db566e..561213e 100644 --- a/src/_gist +++ b/src/_gist @@ -61,21 +61,21 @@ _arguments -C \ '(-l --list)'{-l,--list}'[List all gists for user ]::user' \ '(-h --help)'{-h,--help}'[print options help]' \ '(-v --version)'{-v,--version}'[print version]' \ - '(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:user_gists' \ + '(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:_gist_read_gists' \ '*: :_files' && ret=0 -_user_gists_cache_policy() { +_gist_cache_policy() { # rebuild if cache is more than a day old local -a oldp oldp=( "$1"(mh+1) ) (( $#oldp )) } -user_gists() { +_gist_read_gists() { local update_policy ret=1 zstyle -s ":completion:${curcontext}:" cache-policy update_policy if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy + zstyle ":completion:${curcontext}:" cache-policy _gist_cache_policy fi # stores the gists of the logged in user in the format ID[Description] diff --git a/src/_optirun b/src/_optirun index dbd01fc..3e53e41 100644 --- a/src/_optirun +++ b/src/_optirun @@ -39,29 +39,24 @@ # # ------------------------------------------------------------------------------ -local curcontext="$curcontext" state line -typeset -A opt_args - -local -a arguments - -arguments=( - '--version[output version information]' - '(-h --help)'{-h,--help}'[show help]' - '(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)' - '--failsafe[run a program even if the nvidia card is unavailable]:boolean:(true false)' - '--no-failsafe[do not run a program if the nvidia card is unavailable]' - '--vgl-options[options to be passed to vglrun (example: +tr)]' - '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all logging messages]' - '(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]' - '--debug[set the verbosity level to the maximum]' - '(-b --bridge)'{-b,--bridge}'[specify bridge library to use: VirtualGL, Primus or auto]:method:(auto primus virtualgl none)' - '(-d --display)'{-d,--display}'[the X display number to use]' - '(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files' - '(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files' - '--primus-ldpath[a colon-separated list of paths which are searched for the primus libGL.so.1]:file:_files' - '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files' - '--no-xorg[do not start secondary X server (implies -b none)]' - '*::arguments: _normal' +local -a arguments=( + '--version[output version information]' + '(-h --help)'{-h,--help}'[show help]' + '(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)' + '--failsafe[run a program even if the nvidia card is unavailable]:boolean:(true false)' + '--no-failsafe[do not run a program if the nvidia card is unavailable]' + '--vgl-options[options to be passed to vglrun (example: +tr)]' + '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all logging messages]' + '(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]' + '--debug[set the verbosity level to the maximum]' + '(-b --bridge)'{-b,--bridge}'[specify bridge library to use: VirtualGL, Primus or auto]:method:(auto primus virtualgl none)' + '(-d --display)'{-d,--display}'[the X display number to use]:display:_x_display' + '(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files' + '(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files -/' + '--primus-ldpath[a colon-separated list of paths which are searched for the primus libGL.so.1]:file:_files' + '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files' + '--no-xorg[do not start secondary X server (implies -b none)]' + '*::arguments: _normal' ) _arguments $arguments diff --git a/src/_ralio b/src/_ralio index 0a42270..eaa679b 100644 --- a/src/_ralio +++ b/src/_ralio @@ -28,8 +28,8 @@ # Description # ----------- # -# Completion script for ralio (https://github.com/oesmith/ralio), a -# Rally client +# Completion script for ralio (https://github.com/oesmith/ralio) +# a Rally client # # ------------------------------------------------------------------------------ # Authors @@ -41,98 +41,89 @@ _ralio () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' \ + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) + local -a subcommands=( + "backlog:Show the product backlog" + "sprint:Show the current team iteration" + "show:Show related information for an individual story, defect or task" + "open:Open a story, defect or task in a web browser" + "start:Set a task, defect or story state to in-progress and assign it to you" + "finish:Set a task, defect or story state to completed and assign it to you" + "abandon:Set a task, defect or story state to defined and clear the owner" + "block:Set a task, defect or story state to blocked" + "unblock:Set a task, defect or story state to unblocked" + "current:Show your current tasks and stories" + "point:Set the points for a story or defect" + "task:Allow you to create and delete story tasks." + "configure:Set your Rally configurations." + ) + _describe -t commands 'ralio commands' subcommands - local -a subcommands - subcommands=( - "backlog:Show the product backlog" - "sprint:Show the current team iteration" - "show:Show related information for an individual story, defect or task" - "open:Open a story, defect or task in a web browser" - "start:Set a task, defect or story state to in-progress and assign it to you" - "finish:Set a task, defect or story state to completed and assign it to you" - "abandon:Set a task, defect or story state to defined and clear the owner" - "block:Set a task, defect or story state to blocked" - "unblock:Set a task, defect or story state to unblocked" - "current:Show your current tasks and stories" - "point:Set the points for a story or defect" - "task:Allow you to create and delete story tasks." - "configure:Set your Rally configurations." - ) - _describe -t commands 'ralio commands' subcommands - - _arguments -C \ - {-V,--version}"[display version information]" \ - {-h,--help}"[output usage information]" - ;; - - (options) - case $line[1] in - - - (sprint) - _arguments \ - "-t[Show tasks]" \ - "-p[Project name]" \ - "-f[Filter results]" + _arguments \ + {-V,--version}"[display version information]" \ + {-h,--help}"[output usage information]" + ;; + (options) + case $line[1] in + (sprint) + _arguments \ + "-t[Show tasks]" \ + "-p[Project name]" \ + "-f[Filter results]" ;; - (start | finish) - _arguments \ - '--pair[Pair programming partner]' \ - "--resolution[Resolution status]" \ - "--rootcause[Root cause]" - ;; + (start | finish) + _arguments \ + '--pair[Pair programming partner]' \ + "--resolution[Resolution status]" \ + "--rootcause[Root cause]" + ;; - (task) - __ralio-task - ;; + (task) + __ralio-task + ;; - esac - ;; - esac + esac + ;; + esac } __ralio-task () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) + local -a subcommands=( + "create:Create a new task" + "delete:Delete a task" + ) + _describe -t commands 'ralio task' subcommands + ;; - local -a subcommands - subcommands=( - "create:Create a new task" - "delete:Delete a task" - ) - _describe -t commands 'ralio task' subcommands - ;; - - (options) - case $line[1] in - - (create|delete) - _arguments \ + (options) + case $line[1] in + (create|delete) + _arguments \ -n"[Name of the new task]" \ -t"[Name of the parent task]" - ;; - - esac - ;; - esac + ;; + esac + ;; + esac } _ralio "$@" diff --git a/src/_redis-cli b/src/_redis-cli index 0320f9c..aa3647b 100644 --- a/src/_redis-cli +++ b/src/_redis-cli @@ -36,9 +36,7 @@ # # ------------------------------------------------------------------------------ - -local -a _1st_arguments -_1st_arguments=( +local -a redis_commands=( 'append:append a value to a key' 'auth:authenticate to the server' 'bgrewriteeaof:asynchronously rewrite the append-only file' @@ -163,17 +161,11 @@ _1st_arguments=( 'zunionstore:add multiple sorted sets and store the resulting sorted set in a new key' ) -local expl - _arguments \ '(-v --version)'{-v,--version}'[show version]' \ '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "redis-cli subcommand" _1st_arguments - return -fi + '1::command:{ _describe -t commands "redis-cli subcommand" redis_commands }' \ + && return 0 # Local Variables: # mode: Shell-Script diff --git a/src/_rmlint b/src/_rmlint index 5730ac7..e66c5b2 100644 --- a/src/_rmlint +++ b/src/_rmlint @@ -420,3 +420,11 @@ _rmlint() { } _rmlint "$@" + +# 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 diff --git a/src/_shellcheck b/src/_shellcheck index 20d023e..daab776 100644 --- a/src/_shellcheck +++ b/src/_shellcheck @@ -53,7 +53,7 @@ _arguments \ {-V,--version}'[print version information]' \ {-W,--wiki-link-count=}'[specify number of wiki links to show, when applicable]:number' \ {-x,--external-sources}'[allow outside sources]' \ - '--help[show this usage summary and exit]' \ + '(- *)--help[show this usage summary and exit]' \ '*: :_files' # Local Variables: diff --git a/src/_wemux b/src/_wemux index 691636f..0fde5d8 100644 --- a/src/_wemux +++ b/src/_wemux @@ -37,9 +37,6 @@ # * Akira Maeda # # ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ _wemux() { @@ -80,3 +77,11 @@ _wemux() { } _wemux + +# 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 diff --git a/src/_xsel b/src/_xsel index 460d992..43f9d20 100644 --- a/src/_xsel +++ b/src/_xsel @@ -39,7 +39,7 @@ # ------------------------------------------------------------------------------ local input='(-a --append -f --follow -i --input)' -local operation='(-c --clear -d --delete -k --keep -x --exchange)' +local operation='(-c --clear -d --delete -k --keep -x --exchange)' local selection='(-p --primary -s --secondary -b --clipboard)' _arguments -s \ @@ -58,6 +58,14 @@ _arguments -s \ {-t,--selectionTimeout}'[specify the timeout in milliseconds within which the selection must be retrieved]:number' \ {-l,--logfile}'[specify the file to log errors to when detached (default $HOME/.xsel.log)]:log file:_files' \ {-n,--nodetach}'[do not detach from the controlling terminal]' \ - {-h,--help}'[display usage information and exit]' \ + '(- *)'{-h,--help}'[display usage information and exit]' \ {-v,--verbose}'[print informative messages; additional instances of -v raise the debugging level]' \ - '--version[output version information and exit]' + '(- *)--version[output version information and exit]' + +# 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 From 5e40b7ba096128852a62f7392d3d28ba44bf8dc5 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 4 Aug 2024 14:19:43 +0900 Subject: [PATCH 4/5] Update direnv completion --- src/_direnv | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/_direnv b/src/_direnv index 9edccb5..58be192 100644 --- a/src/_direnv +++ b/src/_direnv @@ -25,7 +25,7 @@ # Description # ----------- # -# Completion script for direnv 2.32.3 (https://direnv.net/) +# Completion script for direnv 2.34.0 (https://direnv.net/) # # ------------------------------------------------------------------------------ # Authors @@ -69,7 +69,7 @@ _direnv() { '*:: :->command_args' && ret=0 case $state in - command_args) + (command_args) case $words[1] in (allow|permit|grant|block|deny|revoke|edit) _arguments \ @@ -93,6 +93,11 @@ _direnv() { '2:integrity hash' \ && ret=0 ;; + (status) + _arguments \ + '--json[print status information in JSON format]' \ + && ret=0 + ;; (version) _arguments \ '1:version at least' \ From 35f2ed45dd5597a82073780aebf968e6db9720e1 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 4 Aug 2024 14:19:54 +0900 Subject: [PATCH 5/5] Update rubocop completion --- src/_rubocop | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_rubocop b/src/_rubocop index deca57d..e8317be 100644 --- a/src/_rubocop +++ b/src/_rubocop @@ -28,7 +28,7 @@ # Description # ----------- # -# Completion script for rubocop 1.55 (https://github.com/rubocop/rubocop) +# Completion script for rubocop 1.65.0 (https://github.com/rubocop/rubocop) # # ------------------------------------------------------------------------------ # Authors @@ -93,6 +93,7 @@ _arguments \ '--display-only-safe-correctable[Only output safe-correctable offense messages with combined with --display-only-correctable]' \ '(-a --autocorrect)'{-a,--autocorrect}"[Auto-correct offenses(only when it's safe)]" \ '(-A --autocorrect-all)'{-A,--autocorrect-all}'[Autocorrect offenses(safe and unsafe)]' \ + '--disable-uncorrectable[used with --autocorrect to annotate any offenses that do not support autocorrect with comments]' \ '--auto-gen-config[Generate a configuration file acting as a TODO list]' \ '--regenerate-todo[Regenerate the TODO configuration file using the last configuration]' \ '(--no-exclude-limit)--exclude-limit[Set the limit for how many files to explicitly exclude]:count' \