diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
commit | 78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch) | |
tree | f515d16b6efd858a9aeb5b0ef5d6f90bf288283d /shell-completion | |
parent | Adding debian version 255.5-1. (diff) | |
download | systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip |
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'shell-completion')
60 files changed, 957 insertions, 306 deletions
diff --git a/shell-completion/bash/bootctl b/shell-completion/bash/bootctl index 8d8b507..45fcd50 100644 --- a/shell-completion/bash/bootctl +++ b/shell-completion/bash/bootctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # bootctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index 5464225..bb80c17 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # busctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/coredumpctl b/shell-completion/bash/coredumpctl index b571990..ebab360 100644 --- a/shell-completion/bash/coredumpctl +++ b/shell-completion/bash/coredumpctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # coredumpctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/homectl b/shell-completion/bash/homectl index 0a7bd0d..5e2235b 100644 --- a/shell-completion/bash/homectl +++ b/shell-completion/bash/homectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # homectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -106,7 +107,12 @@ _homectl() { --cifs-service --stop-delay --kill-processes - --auto-login' + --auto-login + -b --blob + --avatar + --login-background + --session-launcher + --session-type' ) if __contains_word "$prev" ${OPTS[ARG]}; then @@ -117,7 +123,7 @@ _homectl() { --machine|-M) comps=$( __get_machines ) ;; - --identity|--image-path) + --identity|--image-path|--avatar|--login-background) comps=$(compgen -A file -- "$cur" ) compopt -o filenames ;; @@ -130,7 +136,7 @@ _homectl() { --locked|--enforce-password-policy|--password-change-now|--luks-discard|--luks-offline-discard|--nosuid|--nodev|--noexec|--kill-processes|--auto-login) comps='yes no' ;; - -d|--home-dir|--skel) + -d|--home-dir|--skel|-b|--blob) comps=$(compgen -A directory -- "$cur" ) compopt -o dirnames ;; @@ -146,6 +152,15 @@ _homectl() { --cifs-user-name) comps=$(compgen -A user -- "$cur" ) ;; + --language) + comps=$(localectl list-locales 2>/dev/null) + ;; + --session-launcher) + comps=$(find /usr/share/{x,wayland-}sessions/ -type f -name '*.desktop' -exec basename {} .desktop \; 2>/dev/null | sort -u) + ;; + --session-type) + comps='wayland x11 tty' + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl index 63edc08..d8256a9 100644 --- a/shell-completion/bash/hostnamectl +++ b/shell-completion/bash/hostnamectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # hostnamectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -35,7 +36,7 @@ _hostnamectl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( - [STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password' + [STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password -j' [ARG]='-H --host -M --machine --json' ) diff --git a/shell-completion/bash/importctl b/shell-completion/bash/importctl new file mode 100644 index 0000000..d8187d0 --- /dev/null +++ b/shell-completion/bash/importctl @@ -0,0 +1,125 @@ +# shellcheck shell=bash +# importctl(1) completion -*- shell-script -*- +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <https://www.gnu.org/licenses/>. + +__contains_word() { + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done +} + +__get_machines() { + local a b + { machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \ + { while read a b; do echo " $a"; done; } | \ + sort -u +} + +_importctl() { + local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword + local i verb comps + + local -A OPTS=( + [STANDALONE]='--force -h --help -j -N --no-ask-password --no-legend --no-pager -q --quiet --read-only + --version -m -P -S -C' + [ARG]='--host -H -M --machine --json --verify --format --class --keep-download' + ) + + local -A VERBS=( + [STANDALONE]='pull-tar pull-raw list-transfers cancel-transfer list-images' + [FILE]='import-tar import-raw' + [FILE2]='export-tar export-raw' + [DIR]='import-fs' + ) + + _init_completion || return + + for ((i=0; i <= COMP_CWORD; i++)); do + if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && + ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then + verb=${COMP_WORDS[i]} + break + fi + done + + if __contains_word "$prev" ${OPTS[ARG]}; then + case $prev in + --host|-H) + comps=$(compgen -A hostname) + ;; + --machine|-M) + comps=$( __get_machines ) + ;; + --json) + comps='pretty short off' + ;; + --verify) + comps='no checksum signature' + ;; + --format) + comps='uncompressed xz gzip bzip2' + ;; + --class) + comps='machine portable sysext confext' + ;; + --keep-download) + comps='yes no' + ;; + esac + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + fi + + if [[ "$cur" = -* ]]; then + COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) + return 0 + fi + + if [[ -z ${verb-} ]]; then + comps=${VERBS[*]} + elif __contains_word "$verb" ${VERBS[STANDALONE]}; then + comps='' + elif __contains_word "$verb" ${VERBS[DIR]}; then + if (( COMP_CWORD == i + 1 )); then # first argument after verb + comps=$(compgen -d -- "$cur") + compopt -o dirnames + else + comps='' + fi + elif __contains_word "$verb" ${VERBS[FILE]}; then + if (( COMP_CWORD == i + 1 )); then # first argument after verb + comps=$(compgen -f -- "$cur") + compopt -o filenames + else + comps='' + fi + elif __contains_word "$verb" ${VERBS[FILE2]}; then + if (( COMP_CWORD == i + 2 )); then # second argument after verb + comps=$(compgen -f -- "$cur") + compopt -o filenames + else + comps='' + fi + fi + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 +} + +complete -F _importctl importctl diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index 067b053..c79a38c 100644 --- a/shell-completion/bash/journalctl +++ b/shell-completion/bash/journalctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # journalctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -28,7 +29,7 @@ __contains_word () { __get_machines() { local a b { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \ - { while read a b; do echo " $a"; done; } | \ + { while read a b; do echo " $a"; done; } | \ sort -u } @@ -45,10 +46,12 @@ _journalctl() { --version --list-catalog --update-catalog --list-boots --show-cursor --dmesg -k --pager-end -e -r --reverse --utc -x --catalog --no-full --force --dump-catalog - --flush --rotate --sync --no-hostname -N --fields' - [ARG]='-b --boot -D --directory --file -F --field -t --identifier --facility - -M --machine -o --output -u --unit --user-unit -p --priority - --root --case-sensitive' + --flush --rotate --sync --no-hostname -N --fields + --list-namespaces' + [ARG]='-b --boot -D --directory --file -F --field -t --identifier + -T --exclude-identifier --facility -M --machine -o --output + -u --unit --user-unit -p --priority --root --case-sensitive + --namespace' [ARGUNKNOWN]='-c --cursor --interval -n --lines -S --since -U --until --after-cursor --cursor-file --verify-key -g --grep --vacuum-size --vacuum-time --vacuum-files --output-fields' @@ -107,12 +110,15 @@ _journalctl() { --user-unit) comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null) ;; - --identifier|-t) + --identifier|-t|--exclude-identifier|-T) comps=$(journalctl -F 'SYSLOG_IDENTIFIER' 2>/dev/null) ;; --case-sensitive) comps='yes no' ;; + --namespace) + comps=$(journalctl --list-namespaces --output=cat 2>/dev/null) + ;; *) return 0 ;; diff --git a/shell-completion/bash/kernel-install b/shell-completion/bash/kernel-install index 4708777..d3a9d9b 100644 --- a/shell-completion/bash/kernel-install +++ b/shell-completion/bash/kernel-install @@ -1,3 +1,4 @@ +# shellcheck shell=bash # kernel-install(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl index b601343..1717842 100644 --- a/shell-completion/bash/localectl +++ b/shell-completion/bash/localectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # localectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index b307e42..7dbd9c0 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # loginctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -42,9 +43,9 @@ _loginctl () { local -A OPTS=( [STANDALONE]='--all -a --help -h --no-pager --version - --no-legend --no-ask-password -l --full --value' + --no-legend --no-ask-password -l --full --value -j' [ARG]='--host -H --kill-whom --property -p --signal -s -M --machine - -n --lines -o --output -P' + -n --lines -o --output -P --json' ) if __contains_word "$prev" ${OPTS[ARG]}; then @@ -68,6 +69,9 @@ _loginctl () { --output|-o) comps=$( loginctl --output=help 2>/dev/null ) ;; + --json) + comps=$( loginctl --json=help 2>/dev/null ) + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl index b28769b..b3c2e50 100644 --- a/shell-completion/bash/machinectl +++ b/shell-completion/bash/machinectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # machinectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -106,8 +107,12 @@ _machinectl() { comps=$( __get_machines ) elif __contains_word "$verb" ${VERBS[FILE]}; then - comps=$(compgen -f -- "cur") - compopt -o filenames + if (( COMP_CWORD == i + 1 )); then # first argument after verb + comps=$(compgen -f -- "$cur") + compopt -o filenames + else + comps='' + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build index 1588b53..91635df 100644 --- a/shell-completion/bash/meson.build +++ b/shell-completion/bash/meson.build @@ -30,11 +30,14 @@ items = [['busctl', ''], ['systemd-nspawn', ''], ['systemd-path', ''], ['systemd-run', ''], + ['systemd-vpick', ''], ['udevadm', ''], ['bootctl', ''], + ['run0', ''], ['coredumpctl', 'ENABLE_COREDUMP'], ['homectl', 'ENABLE_HOMED'], ['hostnamectl', 'ENABLE_HOSTNAMED'], + ['importctl', 'ENABLE_IMPORTD'], ['kernel-install', 'ENABLE_KERNEL_INSTALL'], ['localectl', 'ENABLE_LOCALED'], ['loginctl', 'ENABLE_LOGIND'], @@ -44,9 +47,11 @@ items = [['busctl', ''], ['portablectl', 'ENABLE_PORTABLED'], ['resolvectl', 'ENABLE_RESOLVE'], ['systemd-cryptenroll', 'HAVE_LIBCRYPTSETUP'], + ['systemd-confext', 'ENABLE_SYSEXT'], ['systemd-dissect', 'HAVE_BLKID'], ['systemd-resolve', 'ENABLE_RESOLVE'], ['systemd-sysext', 'ENABLE_SYSEXT'], + ['systemd-vmspawn', 'ENABLE_VMSPAWN'], ['timedatectl', 'ENABLE_TIMEDATED']] foreach item : items diff --git a/shell-completion/bash/networkctl b/shell-completion/bash/networkctl index db59a9c..6c9daa7 100644 --- a/shell-completion/bash/networkctl +++ b/shell-completion/bash/networkctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # networkctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -28,17 +29,32 @@ __get_links() { networkctl list --no-legend --no-pager --all --full | { while read -r a b c; do echo " $b"; done; }; } +__get_links_with_prefix() { + local i + for i in $(__get_links); do + echo "@$i" + done +} + +__get_files() { + ls {/run,/usr/lib,/etc}/systemd/network/*.{network,netdev,link} 2>/dev/null +} + _networkctl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword local -A OPTS=( - [STANDALONE]='-a --all -h --help --version --no-pager --no-legend -s --stats -l --full' - [ARG]='-n --lines --json' + [STANDALONE]='-a --all -h --help --version --no-pager --no-legend -s --stats -l --full + --no-reload --runtime' + [ARG]='-n --lines --json --drop-in' ) local -A VERBS=( [STANDALONE]='label reload' [LINKS]='status list lldp delete renew up down forcerenew reconfigure' + [FILES_OR_LINKS]='edit cat' + [FILES]='mask unmask' + [BOOL]='persistent-storage' ) _init_completion || return @@ -54,7 +70,7 @@ _networkctl() { if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --json) - comps=$(networkctl --json=help | sort 2>/dev/null) + comps=$(networkctl --json=help) ;; *) return 0 @@ -75,6 +91,12 @@ _networkctl() { comps='' elif __contains_word "$verb" ${VERBS[LINKS]}; then comps=$( __get_links ) + elif __contains_word "$verb" ${VERBS[FILES_OR_LINKS]}; then + comps=$( __get_files; __get_links_with_prefix ) + elif __contains_word "$verb" ${VERBS[FILES]}; then + comps=$( __get_files ) + elif __contains_word "$verb" ${VERBS[BOOL]}; then + comps=$( yes no ) fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/shell-completion/bash/oomctl b/shell-completion/bash/oomctl index dc45ba5..e1ad197 100644 --- a/shell-completion/bash/oomctl +++ b/shell-completion/bash/oomctl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # oomctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/portablectl b/shell-completion/bash/portablectl index 30e5da4..8d88ab4 100644 --- a/shell-completion/bash/portablectl +++ b/shell-completion/bash/portablectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # portablectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -35,7 +36,8 @@ _portablectl() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-q --quiet --runtime --no-reload --cat --no-pager --no-legend - --no-ask-password --enable --now -h --help --version' + --no-ask-password --enable --now -h --help --version + --clean --no-block --force' [ARG]='-p --profile --copy -H --host -M --machine --extension' ) @@ -52,7 +54,7 @@ _portablectl() { comps="default nonetwork strict trusted" ;; --copy) - comps="copy symlink auto" + comps="copy symlink auto mixed" ;; --host|-H) comps=$(compgen -A hostname) diff --git a/shell-completion/bash/resolvectl b/shell-completion/bash/resolvectl index bd3e8bf..344eaad 100644 --- a/shell-completion/bash/resolvectl +++ b/shell-completion/bash/resolvectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # resolvectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -23,7 +24,7 @@ __contains_word () { done } -__get_interfaces(){ +__get_interfaces() { local name for name in $(cd /sys/class/net && command ls); do [[ "$name" != "lo" ]] && echo "$name" @@ -35,10 +36,10 @@ _resolvectl() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version -4 -6 --legend=no --cname=no - --validate=no --synthesize=no --cache=no --zone=no + --validate=no --synthesize=no --cache=no --relax-single-label=no --zone=no --trust-anchor=no --network=no --service-address=no --service-txt=no --search=no --stale-data=no --no-pager' - [ARG]='-t --type -c --class -i --interface -p --protocol --raw' + [ARG]='-t --type -c --class -i --interface -p --protocol --raw --json' ) local -A VERBS=( [DOMAIN]='query service openpgp' @@ -49,7 +50,7 @@ _resolvectl() { [RESOLVE]='llmnr mdns' [DNSSEC]='dnssec' [DNSOVERTLS]='dnsovertls' - [STANDALONE]='statistics reset-statistics flush-caches reset-server-features show-cache' + [STANDALONE]='statistics reset-statistics flush-caches reset-server-features monitor show-cache show-server-state' [LOG_LEVEL]='log-level' ) local -A ARGS=( @@ -59,14 +60,13 @@ _resolvectl() { [DNSSEC]='yes no allow-downgrade' [DNSOVERTLS]='yes no opportunistic' ) - local interfaces=$( __get_interfaces ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --interface|-i) - comps="$interfaces" + comps=$( __get_interfaces ) ;; - --protocol|-p|--type|-t|--class|-c) + --protocol|-p|--type|-t|--class|-c|--json) comps=$( resolvectl --legend=no "$prev" help; echo help ) ;; --raw) @@ -97,7 +97,7 @@ _resolvectl() { comps='' elif __contains_word "$verb" ${VERBS[STATUS]}; then - comps="$interfaces" + comps=$( __get_interfaces ) elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then comps='debug info notice warning err crit alert emerg' @@ -117,6 +117,7 @@ _resolvectl() { fi elif __contains_word "$verb" ${VERBS[LINK]} ${VERBS[BOOLEAN]} ${VERBS[RESOLVE]} ${VERBS[DNSSEC]} ${VERBS[DNSOVERTLS]}; then + local interfaces=$( __get_interfaces ) for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" $interfaces && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then diff --git a/shell-completion/bash/run0 b/shell-completion/bash/run0 new file mode 100644 index 0000000..96610e4 --- /dev/null +++ b/shell-completion/bash/run0 @@ -0,0 +1,113 @@ +# shellcheck shell=bash +# run0(1) completion -*- shell-script -*- +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <https://www.gnu.org/licenses/>. + +__systemctl() { + systemctl --system --full --no-legend --no-pager --plain "$@" +} + +__get_slice_units () { __systemctl list-units --all -t slice \ + | { while read -r a b c d; do echo " $a"; done; }; } + +__get_machines() { + local a b + { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \ + { while read a b; do echo " $a"; done; } | \ + sort -u +} + +_run0() { + local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + local opts_with_values=( + --machine --unit --property --description --slice -u --user -g --group --nice -D --chdir + --setenv --background + ) + local OPTS="${opts_with_values[*]} -h --help -V --version --no-ask-password --slice-inherit" + + local i + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + local root_command=${COMP_WORDS[i]} + _command_offset ${i} + return + fi + + [[ ${i} -lt ${COMP_CWORD} && " ${opts_with_values[@]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) + done + + case "${prev}" in + --unit|--description|--nice|--setenv|--background) + # argument required but no completions available + return + ;; + --slice) + local comps=$(__get_slice_units) + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + ;; + --property) + local comps='CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= + SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= + DevicePolicy= KillMode= ExitType= DeviceAllow= BlockIOReadBandwidth= + BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= + KillSignal= RestartKillSignal= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA= + LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= + LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= + LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= + PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= + TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= + SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= + ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= + ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment=' + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + ;; + --machine) + local comps=$( __get_machines ) + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + ;; + -u|--user) + COMPREPLY=($(compgen -u -- "$cur")) + return 0 + ;; + -g|--group) + COMPREPLY=($(compgen -g -- "$cur")) + return 0 + ;; + -D|--chdir) + local comps + if [[ -z $cur ]]; then + comps=$(compgen -A directory -- "/" ) + else + comps=$(compgen -A directory -- "$cur" ) + fi + compopt -o filenames + COMPREPLY=( $(compgen -W '$comps' -- "$cur" ) ) + return 0 + ;; + esac + + COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) + return 0 +} + +complete -F _run0 run0 diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index 5c444b7..f4576c4 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemctl(1) completion -*- shell-script -*- # vi: ft=sh # SPDX-License-Identifier: LGPL-2.1-or-later @@ -192,7 +193,7 @@ _systemctl () { comps='auto yes no' ;; --what) - comps='configuration state cache logs runtime all' + comps='configuration state cache logs runtime fdstore all' ;; --image) comps=$(compgen -A file -- "$cur") diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 1fde672..75ea1dc 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-analyze(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -51,6 +52,10 @@ __get_syscall_sets() { done } +__get_architectures() { + systemd-analyze --no-legend --no-pager architectures | { while read -r a b; do echo " $a"; done } +} + _systemd_analyze() { local i verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword @@ -62,7 +67,7 @@ _systemd_analyze() { ) local -A VERBS=( - [STANDALONE]='time blame unit-paths exit-status calendar timestamp timespan' + [STANDALONE]='time blame unit-files unit-paths exit-status capability compare-versions calendar timestamp timespan pcrs srk' [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' [DUMP]='dump' @@ -73,11 +78,13 @@ _systemd_analyze() { [CONDITION]='condition' [INSPECT_ELF]='inspect-elf' [PLOT]='plot' + [ARCHITECTURES]='architectures' + [FDSTORE]='fdstore' ) - local CONFIGS='systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf + local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf systemd/journal-remote.conf systemd/journal-upload.conf systemd/logind.conf - systemd/resolved.conf systemd/networkd.conf systemd/resolved.conf + systemd/resolved.conf systemd/networkd.conf systemd/pstore.conf systemd/resolved.conf systemd/sleep.conf systemd/system.conf systemd/timedated.conf systemd/timesyncd.conf systemd/user.conf udev/udev.conf' @@ -198,6 +205,20 @@ _systemd_analyze() { if [[ $cur = -* ]]; then comps='--help --version --system --user --global --no-pager --json=off --json=pretty --json=short --table --no-legend' fi + + elif __contains_word "$verb" ${VERBS[ARCHITECTURES]}; then + if [[ $cur = -* ]]; then + comps='--help --version --no-pager --json=off --json=pretty --json=short --no-legend' + else + comps=$( __get_architectures ) + fi + + elif __contains_word "$verb" ${VERBS[FDSTORE]}; then + if [[ $cur = -* ]]; then + comps='--help --version --system --user --global -H --host -M --machine --no-pager --json=off --json=pretty --json=short --root --image' + else + comps=$( __get_services $mode ) + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/shell-completion/bash/systemd-cat b/shell-completion/bash/systemd-cat index b209140..0d7e3d7 100644 --- a/shell-completion/bash/systemd-cat +++ b/shell-completion/bash/systemd-cat @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-cat(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -30,7 +31,7 @@ _systemd_cat() { local -A OPTS=( [STANDALONE]='-h --help --version' - [ARG]='-t --identifier -p --priority --level-prefix' + [ARG]='-t --identifier -p --priority --stderr-priority --level-prefix --namespace' ) _init_completion || return @@ -40,12 +41,15 @@ _systemd_cat() { --identifier|-t) comps='' ;; - --priority|-p) + --priority|-p|--stderr-priority) comps='emerg alert crit err warning notice info debug' ;; --level-prefix) comps='yes no' ;; + --namespace) + comps=$(journalctl --list-namespaces --output=cat 2>/dev/null) + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 diff --git a/shell-completion/bash/systemd-cgls b/shell-completion/bash/systemd-cgls index 8dda5a8..49739bd 100644 --- a/shell-completion/bash/systemd-cgls +++ b/shell-completion/bash/systemd-cgls @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-cgls(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -44,7 +45,7 @@ _systemd_cgls() { local -A OPTS=( [STANDALONE]='-h --help --version --all -l --full -k --no-pager --xattr=no --cgroup-id=no' - [ARG]='-M --machine -u --unit --user-unit' + [ARG]='-c --cgroup-id -M --machine -u --unit --user-unit -x --xattr' ) _init_completion || return @@ -57,6 +58,9 @@ _systemd_cgls() { --unit|-u) comps=$( __get_units_have_cgroup --system ) ;; + -c|--cgroup-id|-x|--xattr) + comps='yes no' + ;; --user-unit) comps=$( __get_units_have_cgroup --user ) ;; diff --git a/shell-completion/bash/systemd-cgtop b/shell-completion/bash/systemd-cgtop index 731d9c9..6a33cb2 100644 --- a/shell-completion/bash/systemd-cgtop +++ b/shell-completion/bash/systemd-cgtop @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-cgtop(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-confext b/shell-completion/bash/systemd-confext index c8eca3b..d36f70f 100644 --- a/shell-completion/bash/systemd-confext +++ b/shell-completion/bash/systemd-confext @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-confext(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -30,9 +31,12 @@ _systemd-confext() { [STANDALONE]='-h --help --version --no-pager --no-legend + --no-reload --force' [ARG]='--root - --json' + --json + --noexec + --image-policy' ) local -A VERBS=( @@ -54,6 +58,12 @@ _systemd-confext() { --json) comps='pretty short off' ;; + --noexec) + comps='false true' + ;; + --image-policy) + comps='' + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 diff --git a/shell-completion/bash/systemd-cryptenroll b/shell-completion/bash/systemd-cryptenroll index 1723f75..6b13e58 100644 --- a/shell-completion/bash/systemd-cryptenroll +++ b/shell-completion/bash/systemd-cryptenroll @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-cryptenroll(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -52,6 +53,7 @@ _systemd_cryptenroll() { --password --recovery-key' [ARG]='--unlock-key-file --unlock-fido2-device + --unlock-tpm2-device --pkcs11-token-uri --fido2-credential-algorithm --fido2-device @@ -81,6 +83,9 @@ _systemd_cryptenroll() { --unlock-fido2-device) comps="auto $(__get_fido2_devices)" ;; + --unlock-tpm2-device) + comps="auto $(__get_tpm2_devices)" + ;; --pkcs11-token-uri) comps='auto list pkcs11:' ;; diff --git a/shell-completion/bash/systemd-delta b/shell-completion/bash/systemd-delta index b148755..ac7f5e9 100644 --- a/shell-completion/bash/systemd-delta +++ b/shell-completion/bash/systemd-delta @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-delta(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-detect-virt b/shell-completion/bash/systemd-detect-virt index 9ade2af..edc861b 100644 --- a/shell-completion/bash/systemd-detect-virt +++ b/shell-completion/bash/systemd-detect-virt @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-detect-virt(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-dissect b/shell-completion/bash/systemd-dissect index 17fb642..8d2b434 100644 --- a/shell-completion/bash/systemd-dissect +++ b/shell-completion/bash/systemd-dissect @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-dissect(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-id128 b/shell-completion/bash/systemd-id128 index 1c19639..54d4ec8 100644 --- a/shell-completion/bash/systemd-id128 +++ b/shell-completion/bash/systemd-id128 @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-id128(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -28,12 +29,13 @@ _systemd_id128() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword local -A OPTS=( - [STANDALONE]='-h --help --version -p --pretty' - [ARG]='-a --app-specific' + [STANDALONE]='-h --help --version -p --pretty --value -u --uuid --no-legend --no-pager -j' + [ARG]='-a --app-specific --json' ) local -A VERBS=( [STANDALONE]='new machine-id boot-id invocation-id help' + [ARG]='show' ) _init_completion || return @@ -43,6 +45,9 @@ _systemd_id128() { --app-specific|-a) comps="" ;; + --json) + comps="short pretty off" + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 @@ -65,6 +70,12 @@ _systemd_id128() { comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' + elif __contains_word "$verb" ${VERBS[ARG]}; then + case $verb in + show) + comps="$(IFS='\n ' systemd-id128 show --no-legend)" + ;; + esac fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn index cc3d2f6..0a1761d 100644 --- a/shell-completion/bash/systemd-nspawn +++ b/shell-completion/bash/systemd-nspawn @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-nspawn(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -68,19 +69,19 @@ _systemd_nspawn() { --keep-unit -n --network-veth -j -x --ephemeral -a --as-pid2 -U --suppress-sync=yes' [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine -S --slice -E --setenv -Z --selinux-context -L --selinux-apifs-context - --register --network-interface --network-bridge --personality -i --image --tmpfs + --register --network-interface --network-bridge --personality -i --image --image-policy --tmpfs --volatile --network-macvlan --kill-signal --template --notify-ready --root-hash --chdir --pivot-root --property --private-users --private-users-ownership --network-namespace-path --network-ipvlan --network-veth-extra --network-zone -p --port --system-call-filter --overlay --overlay-ro --settings --rlimit --hostname --no-new-privileges --oom-score-adjust --cpu-affinity - --resolv-conf --timezone --root-hash-sig' + --resolv-conf --timezone --root-hash-sig --background --oci-bundle --verity-data' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in - --directory|-D|--template) + --directory|-D|--template|--oci-bundle) compopt -o nospace comps=$(compgen -S/ -A directory -- "$cur" ) ;; diff --git a/shell-completion/bash/systemd-path b/shell-completion/bash/systemd-path index 40e2f7e..59d6597 100644 --- a/shell-completion/bash/systemd-path +++ b/shell-completion/bash/systemd-path @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-path(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-resolve b/shell-completion/bash/systemd-resolve index 20d904a..17890a9 100644 --- a/shell-completion/bash/systemd-resolve +++ b/shell-completion/bash/systemd-resolve @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-resolve(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-run b/shell-completion/bash/systemd-run index c18228d..4bc8206 100644 --- a/shell-completion/bash/systemd-run +++ b/shell-completion/bash/systemd-run @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-run(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -33,21 +34,17 @@ __get_machines() { _systemd_run() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} - local OPTS='--no-ask-password --scope -u --unit -p --property --description --slice --slice-inherit - -r --remain-after-exit --send-sighup --service-type --uid --gid --nice - --working-directory -d --same-dir -E --setenv -t --pty -P --pipe -S --shell -q --quiet - --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar - --on-clock-change --on-timezone-change --path-property --socket-property - --timer-property --no-block --wait -G --collect --user --system -H --host -M --machine - -h --help --version' - - local mode=--system - local i local opts_with_values=( --unit -p --property --slice --description --service-type --uid --gid --nice --working-directory -E --setenv --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar - --path-property --socket-property --timer-property -H --host -M --machine + --path-property --socket-property --timer-property -H --host -M --machine --expand-environment + --background ) + local OPTS="${opts_with_values[*]} --no-ask-password --scope -u --slice-inherit -r --remain-after-exit + --send-sighup -d --same-dir -t --pty -P --pipe -S --shell -q --quiet --ignore-failure + --on-clock-change --on-timezone-change --no-block --wait -G --collect --user --system -h --help --version" + local mode=--system + local i for (( i=1; i <= COMP_CWORD; i++ )); do if [[ ${COMP_WORDS[i]} != -* ]]; then local root_command=${COMP_WORDS[i]} @@ -57,14 +54,20 @@ _systemd_run() { [[ ${COMP_WORDS[i]} == "--user" ]] && mode=--user - [[ $i -lt $COMP_CWORD && " ${opts_with_values[@]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) + [[ $i -lt $COMP_CWORD && " ${opts_with_values[*]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) done case "$prev" in - --unit|--description|--on-active|--on-boot|--on-startup|--on-unit-active|--on-unit-inactive|--on-calendar) + --unit|--description|--on-active|--on-boot|--on-startup|--on-unit-active|--on-unit-inactive|--on-calendar|--background) # argument required but no completions available return ;; + --expand-environment) + local comps='yes no' + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + ;; --slice) local comps=$(__get_slice_units $mode) diff --git a/shell-completion/bash/systemd-sysext b/shell-completion/bash/systemd-sysext index b3f9f32..5c15f07 100644 --- a/shell-completion/bash/systemd-sysext +++ b/shell-completion/bash/systemd-sysext @@ -1,3 +1,4 @@ +# shellcheck shell=bash # systemd-sysext(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/systemd-vmspawn b/shell-completion/bash/systemd-vmspawn new file mode 100644 index 0000000..7043ce2 --- /dev/null +++ b/shell-completion/bash/systemd-vmspawn @@ -0,0 +1,70 @@ +# shellcheck shell=bash +# systemd-vmspawn(1) completion -*- shell-script -*- +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <https://www.gnu.org/licenses/>. + +__contains_word() { + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done +} + +_systemd_vmspawn() { + local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword + local i verb comps + + local -A OPTS=( + [STANDALONE]='-h --help --version -q --quiet --no-pager -n --network-tap --network-user-mode' + [PATH]='-D --directory -i --image --linux --initrd --extra-drive --forward-journal' + [BOOL]='--kvm --vsock --tpm --secure-boot --discard-disk --register --pass-ssh-key' + [FIRMWARE]='--firmware' + [BIND]='--bind --bind-ro' + [SSH_KEY]='--ssh-key' + [CONSOLE]='--console' + [ARG]='--cpus --ram --vsock-cid -M --machine --uuid--private-users --background --set-credential --load-credential' + ) + + _init_completion || return + + if __contains_word "$prev" ${OPTS[BOOL]}; then + comps='yes no' + elif __contains_word "$prev" ${OPTS[PATH]}; then + compopt -o nospace -o filenames + comps=$(compgen -f -- "$cur" ) + elif __contains_word "$prev" ${OPTS[FIRMWARE]}; then + compopt -o nospace -o filenames + comps="list $(compgen -f -- "$cur" )" + elif __contains_word "$prev" ${OPTS[BIND]}; then + compopt -o nospace -o filenames + comps=$(compgen -f -- "${cur}" ) + elif __contains_word "$prev" ${OPTS[SSH_KEY]}; then + comps='dsa ecdsa ecdsa-sk ed25519 ed25519-sk rsa' + elif __contains_word "$prev" ${OPTS[CONSOLE]}; then + comps='interactive native gui' + elif __contains_word "$prev" ${OPTS[ARG]}; then + comps='' + else + COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) + return 0 + fi + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + +} + +complete -F _systemd_vmspawn systemd-vmspawn diff --git a/shell-completion/bash/systemd-vpick b/shell-completion/bash/systemd-vpick new file mode 100644 index 0000000..7c67c0f --- /dev/null +++ b/shell-completion/bash/systemd-vpick @@ -0,0 +1,60 @@ +# shellcheck shell=bash +# systemd-vpick(1) completion -*- shell-script -*- +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <https://www.gnu.org/licenses/>. + +__contains_word() { + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done +} + +_systemd-vpick() { + local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword + local comps + + local -A OPTS=( + [STANDALONE]='--help -h --version' + [ARG]='-B --baseline -V -A -S --suffix --type -p --print --resolve' + ) + + _init_completion || return + + if __contains_word "$prev" ${OPTS[ARG]}; then + case $prev in + -p|--print) + comps='filename version type arch tries all' + ;; + --resolve) + comps='yes no' + ;; + esac + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + return 0 + fi + + if [[ "$cur" = -* ]] || [[ -z ${comps-} ]]; then + COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) + return 0 + fi + + COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") ) + return 0 +} + +complete -F _systemd-vpick systemd-vpick diff --git a/shell-completion/bash/timedatectl b/shell-completion/bash/timedatectl index 768b4a5..f22cde2 100644 --- a/shell-completion/bash/timedatectl +++ b/shell-completion/bash/timedatectl @@ -1,3 +1,4 @@ +# shellcheck shell=bash # timedatectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm index 0606160..05f921c 100644 --- a/shell-completion/bash/udevadm +++ b/shell-completion/bash/udevadm @@ -1,3 +1,4 @@ +# shellcheck shell=bash # udevadm(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -30,7 +31,7 @@ __get_all_sysdevs() { printf '%s\n' "${devs[@]%/}" } -__get_all_devs() { +__get_all_device_nodes() { local i for i in /dev/* /dev/*/* /dev/*/*/*; do echo $i @@ -42,15 +43,23 @@ __get_all_device_units() { { while read -r a b; do echo "$a"; done; } } +__get_all_devices() { + __get_all_sysdevs + __get_all_device_nodes + __get_all_device_units +} + _udevadm() { local i verb comps builtin local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [COMMON]='-h --help -V --version' [DEBUG]='-d --debug' - [INFO_STANDALONE]='-r --root -a --attribute-walk -x --export -e --export-db -c --cleanup-db - -w --wait-for-initialization --value' - [INFO_ARG]='-q --query -p --path -n --name -P --export-prefix -d --device-id-of-file --property' + [INFO_STANDALONE]='-r --root -a --attribute-walk -t --tree -x --export -e --export-db -c --cleanup-db + -w --wait-for-initialization --value --no-pager --initialized-match --initialized-nomatch' + [INFO_ARG]='-q --query -p --path -n --name -P --export-prefix -d --device-id-of-file --property + --json --subsystem-match --subsystem-nomatch --attr-match --attr-nomatch --property-match + --tag-match --sysname-match --name-match --parent-match' [TRIGGER_STANDALONE]='-v --verbose -n --dry-run -q --quiet -w --settle --wait-daemon --uuid --initialized-match --initialized-nomatch' [TRIGGER_ARG]='-t --type -c --action -s --subsystem-match -S --subsystem-nomatch @@ -58,7 +67,8 @@ _udevadm() { -g --tag-match -y --sysname-match --name-match -b --parent-match --prioritized-subsystem' [SETTLE]='-t --timeout -E --exit-if-exists' - [CONTROL_STANDALONE]='-e --exit -s --stop-exec-queue -S --start-exec-queue -R --reload --ping' + [CONTROL_STANDALONE]='-e --exit -s --stop-exec-queue -S --start-exec-queue -R --reload --ping + --load-credentials' [CONTROL_ARG]='-l --log-priority -p --property -m --children-max -t --timeout' [MONITOR_STANDALONE]='-k --kernel -u --udev -p --property' [MONITOR_ARG]='-s --subsystem-match -t --tag-match' @@ -100,7 +110,17 @@ _udevadm() { local IFS=$'\n' ;; -n|--name) - comps=$( __get_all_devs ) + comps=$( __get_all_device_nodes ) + ;; + --json) + comps=$( udevadm info --json=help ) + ;; + --parent-match) + comps=$( __get_all_sysdevs ) + local IFS=$'\n' + ;; + --name-match) + comps=$( __get_all_device_nodes ) ;; *) comps='' @@ -113,7 +133,7 @@ _udevadm() { if [[ $cur = -* ]]; then comps="${OPTS[COMMON]} ${OPTS[INFO_STANDALONE]} ${OPTS[INFO_ARG]}" else - comps=$( __get_all_sysdevs; __get_all_device_units ) + comps=$( __get_all_devices ) local IFS=$'\n' fi ;; @@ -132,7 +152,7 @@ _udevadm() { local IFS=$'\n' ;; --name-match) - comps=$( __get_all_devs ) + comps=$( __get_all_device_nodes ) ;; *) comps='' @@ -145,7 +165,7 @@ _udevadm() { if [[ $cur = -* ]]; then comps="${OPTS[COMMON]} ${OPTS[TRIGGER_STANDALONE]} ${OPTS[TRIGGER_ARG]}" else - comps=$( __get_all_sysdevs; __get_all_device_units ) + comps=$( __get_all_devices ) local IFS=$'\n' fi ;; @@ -215,7 +235,7 @@ _udevadm() { if [[ $cur = -* ]]; then comps="${OPTS[COMMON]} ${OPTS[TEST]}" else - comps=$( __get_all_sysdevs ) + comps=$( __get_all_devices ) local IFS=$'\n' fi ;; @@ -243,7 +263,7 @@ _udevadm() { elif [[ $cur = -* ]]; then comps="${OPTS[COMMON]} ${OPTS[TEST_BUILTIN]}" else - comps=$( __get_all_sysdevs ) + comps=$( __get_all_devices ) local IFS=$'\n' fi ;; @@ -287,7 +307,7 @@ _udevadm() { if [[ $cur = -* ]]; then comps="${OPTS[COMMON]} ${OPTS[WAIT]}" else - comps=$( __get_all_devs ) + comps=$( __get_all_devices ) local IFS=$'\n' fi ;; diff --git a/shell-completion/zsh/_bootctl b/shell-completion/zsh/_bootctl index 83d910c..f021978 100644 --- a/shell-completion/zsh/_bootctl +++ b/shell-completion/zsh/_bootctl @@ -69,12 +69,12 @@ _bootctl_reboot-to-firmware() { } _arguments \ - {-h,--help}'[Prints a short help text and exits.]' \ - '--version[Prints a short version string and exits.]' \ + '(- *)'{-h,--help}'[Prints a short help text and exits.]' \ + '(- *)--version[Prints a short version string and exits.]' \ '--esp-path=[Path to the EFI System Partition (ESP)]:path:_directories' \ '--boot-path=[Path to the $BOOT partition]:path:_directories' \ - {-p,--print-esp-path}'[Print path to the EFI system partition]' \ - {-x,--print-boot-path}'[Print path to the $BOOT partition]' \ + '(-p --print-esp-path)'{-p,--print-esp-path}'[Print path to the EFI system partition]' \ + '(-x --print-boot-path)'{-x,--print-boot-path}'[Print path to the $BOOT partition]' \ '--make-machine-id-directory=[Control creation and deletion of the top-level machine ID directory.]:options:(yes no auto)' \ '--no-variables[Do not touch EFI variables]' \ '--no-pager[Do not pipe output into a pager]' \ diff --git a/shell-completion/zsh/_busctl b/shell-completion/zsh/_busctl index 70f9e74..d8d7adf 100644 --- a/shell-completion/zsh/_busctl +++ b/shell-completion/zsh/_busctl @@ -259,14 +259,14 @@ local -a _modes; _modes=("--user" "--system") local _bus_address=${${words:*_modes}[(R)(${(j.|.)_modes})]} local curcontext=$curcontext state line _arguments \ - {-h,--help}'[Prints a short help text and exits.]' \ - '--version[Prints a short version string and exits.]' \ + '(- *)'{-h,--help}'[Prints a short help text and exits.]' \ + '(- *)--version[Prints a short version string and exits.]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-legend[Do not show the headers and footers]' \ '--system[Connect to system manager]' \ '--user[Connect to user service manager]' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '--address=[Connect to the bus specified by address]:address' \ '--show-machine[Show machine ID column in list]' \ '--unique[Only show unique names]' \ @@ -274,7 +274,7 @@ _arguments \ '--activatable[Only show activatable names]' \ '--match=[Only show matching messages]:match:__dbus_matchspec' \ '--list[Do not show tree, but simple object path list]' \ - {-q,--quiet}'[Do not show method call reply]'\ + '(-q --quiet)'{-q,--quiet}'[Do not show method call reply]'\ '--verbose[Show result values in long format]' \ '--xml-interface[Dump the XML description in introspect command]' \ '--json=[Show result values in long format]:format:_busctl_get_json' \ diff --git a/shell-completion/zsh/_coredumpctl b/shell-completion/zsh/_coredumpctl index dad21a7..7472626 100644 --- a/shell-completion/zsh/_coredumpctl +++ b/shell-completion/zsh/_coredumpctl @@ -30,18 +30,18 @@ _coredumpctl_commands(){ } _arguments \ - {-o+,--output=}'[Write output to FILE]:output file:_files' \ - {-F+,--field=}'[Show field in list output]:field' \ + '(-o --output)'{-o+,--output=}'[Write output to FILE]:output file:_files' \ + '(-F --field)'{-F+,--field=}'[Show field in list output]:field' \ '-1[Show information about most recent entry only]' \ - {-S,--since}'[Print entries since the specified date]' \ - {-U,--until}'[Print entries until the specified date]' \ - {-r,--reverse}'[Show the newest entries first]' \ + '(-S --since)'{-S,--since}'[Print entries since the specified date]' \ + '(-U --until)'{-U,--until}'[Print entries until the specified date]' \ + '(-r --reverse)'{-r,--reverse}'[Show the newest entries first]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-legend[Do not print the column headers]' \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ '--debugger=[Use the given debugger]:debugger: _command_names -e' \ - {-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \ - {-q,--quiet}'[Do not show info messages and privilege warning]' \ + '(-D --directory)'{-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \ + '(-q --quiet)'{-q,--quiet}'[Do not show info messages and privilege warning]' \ '--all[Look at all journal files instead of local ones]' \ '*::coredumpctl commands:_coredumpctl_commands' diff --git a/shell-completion/zsh/_hostnamectl b/shell-completion/zsh/_hostnamectl index bdd26b1..7647393 100644 --- a/shell-completion/zsh/_hostnamectl +++ b/shell-completion/zsh/_hostnamectl @@ -83,13 +83,13 @@ _hostnamectl_commands() { } _arguments -s \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ '--transient[Only set transient hostname]' \ '--static[Only set static hostname]' \ '--pretty[Only set pretty hostname]' \ '--no-ask-password[Do not prompt for password]' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ - '--json[Shows output formatted as JSON]:format:_hostnamectl_get_json' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ + '--json=[Shows output formatted as JSON]:format:_hostnamectl_get_json' \ '*::hostnamectl commands:_hostnamectl_commands' diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl index b77bf3f..1cfa049 100644 --- a/shell-completion/zsh/_journalctl +++ b/shell-completion/zsh/_journalctl @@ -63,6 +63,13 @@ _journalctl_facilities() { _describe 'possible values' _journalctl_facilities } +(( $+functions[_journalctl_namespaces] )) || +_journalctl_namespaces() { + local -a _journalctl_namespaces + _journalctl_namespaces=( ${(f)"$(_call_program namespaces "$service --list-namespaces --output=cat" 2>/dev/null)"} ) + _describe 'possible values' _journalctl_namespaces +} + # Build arguments for "journalctl" to be used in completion. # Use both --user and --system modes, they are not exclusive. local -a _modes; _modes=(--user --system) @@ -89,37 +96,37 @@ while (( i++ < n )); do fi done _arguments -s \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ '--no-pager[Do not pipe output into a pager]' \ --no-hostname"[Don't show the hostname of local log messages]" \ - {-l,--full}'[Show long fields in full]' \ - {-a,--all}'[Show all fields, including long and unprintable]' \ - {-f,--follow}'[Follow journal]' \ - {-e,--pager-end}'[Jump to the end of the journal in the pager]' \ - {-n+,--lines=}'[Number of journal entries to show]:integer' \ + '(-l --full)'{-l,--full}'[Show long fields in full]' \ + '(-a --all)'{-a,--all}'[Show all fields, including long and unprintable]' \ + '(-f --follow)'{-f,--follow}'[Follow journal]' \ + '(-e --pager-end)'{-e,--pager-end}'[Jump to the end of the journal in the pager]' \ + '(-n --lines)'{-n+,--lines=}'[Number of journal entries to show]:integer' \ '--no-tail[Show all lines, even in follow mode]' \ - {-r,--reverse}'[Reverse output]' \ - {-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \ - {-x,--catalog}'[Show explanatory texts with each log line]' \ - {-q,--quiet}"[Don't show privilege warning]" \ - {-m,--merge}'[Show entries from all available journals]' \ - {-b+,--boot=}'[Show data only from the specified boot or offset]::boot id or offset:_journalctl_boots' \ + '(-r --reverse)'{-r,--reverse}'[Reverse output]' \ + '(-o --output)'{-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \ + '(-x --catalog)'{-x,--catalog}'[Show explanatory texts with each log line]' \ + '(-q --quiet)'{-q,--quiet}"[Don't show privilege warning]" \ + '(-m --merge)'{-m,--merge}'[Show entries from all available journals]' \ + '(-b --boot)'{-b+,--boot=}'[Show data only from the specified boot or offset]::boot id or offset:_journalctl_boots' \ '--list-boots[List boots ordered by time]' \ - {-k,--dmesg}'[Show only kernel messages from the current boot]' \ - {-u+,--unit=}'[Show data only from the specified unit]:units:_journalctl_field_values _SYSTEMD_UNIT' \ + '(-k --dmesg)'{-k,--dmesg}'[Show only kernel messages from the current boot]' \ + '(-u --unit)'{-u+,--unit=}'[Show data only from the specified unit]:units:_journalctl_field_values _SYSTEMD_UNIT' \ '--user-unit=[Show data only from the specified user session unit]:units:_journalctl_field_values USER_UNIT' \ - {-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journalctl_field_values PRIORITY' \ + '(-p --priority)'{-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journalctl_field_values PRIORITY' \ '--facility=[Filter messages by facility]:facility:_journalctl_facilities' \ - {-t+,--identifier=}'[Filter messages by syslog identifier]:identifier:_journalctl_field_values SYSLOG_IDENTIFIER' \ - {-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journalctl_field_values __CURSORS' \ + '(-t --identifier)'{-t+,--identifier=}'[Filter messages by syslog identifier]:identifier:_journalctl_field_values SYSLOG_IDENTIFIER' \ + '(-c --cursor)'{-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journalctl_field_values __CURSORS' \ '--cursor-file=[Show entries using cursor stored in file]:file:_files' \ '--after-cursor=[Start showing entries from after the specified cursor]:cursors:_journalctl_field_values __CURSORS' \ '--since=[Start showing entries on or newer than the specified date]:YYYY-MM-DD HH\:MM\:SS' \ '--until=[Stop showing entries on or older than the specified date]:YYYY-MM-DD HH\:MM\:SS' \ - {-g+,--grep=}'[Show entries with MESSAGE field matching PCRE pattern]' \ + '(-g --grep)'{-g+,--grep=}'[Show entries with MESSAGE field matching PCRE pattern]' \ '--case-sensitive=[Force case sensitive or insensitive matching]:boolean:(true false)' \ - {-F,--field=}'[List all values a certain field takes]:Fields:_journalctl_fields' \ + '(-F --field)'{-F,--field=}'[List all values a certain field takes]:Fields:_journalctl_fields' \ '--system[Show system and kernel messages]' \ '--user[Show messages from user services]' \ '(--directory -D -M --machine --root --file)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ @@ -133,6 +140,8 @@ _arguments -s \ '--header[Show journal header information]' \ '--interval=[Time interval for changing the FSS sealing key]:time interval' \ '--list-catalog[List messages in catalog]' \ + '--list-namespaces[List available journal namespaces]' \ + '--namespace[Show journal data from specified namespace]:namespace:_journalctl_namespaces' \ '--new-id128[Generate a new 128 Bit ID]' \ '--rotate[Request immediate rotation of the journal files]' \ '--setup-keys[Generate a new FSS key pair]' \ diff --git a/shell-completion/zsh/_kernel-install b/shell-completion/zsh/_kernel-install index cb2565d..0e786e3 100644 --- a/shell-completion/zsh/_kernel-install +++ b/shell-completion/zsh/_kernel-install @@ -22,6 +22,8 @@ _kernel-install_kernels(){ } _arguments \ + '(- :)'{-h,--help}'[Show help]' \ + '(- :)--version[Show package version]' \ '1::add or remove:(add remove)' \ '2::kernel versions:_kernel-install_kernels' \ '3::kernel images:_kernel-install_images' diff --git a/shell-completion/zsh/_localectl b/shell-completion/zsh/_localectl index 65babe2..8c09841 100644 --- a/shell-completion/zsh/_localectl +++ b/shell-completion/zsh/_localectl @@ -88,11 +88,11 @@ _localectl_commands() { } _arguments \ - {-h,--help}'[Show this help]' \ + '(- *)'{-h,--help}'[Show this help]' \ '--version[Show package version]' \ "--no-convert[Don't convert keyboard mappings]" \ '--no-pager[Do not pipe output into a pager]' \ '--no-ask-password[Do not prompt for password]' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machine' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machine' \ '*::localectl commands:_localectl_commands' diff --git a/shell-completion/zsh/_loginctl b/shell-completion/zsh/_loginctl index 5473020..5e86ff6 100644 --- a/shell-completion/zsh/_loginctl +++ b/shell-completion/zsh/_loginctl @@ -165,18 +165,18 @@ _loginctl_commands() { _arguments -s \ - {-h,--help}'[Show help]' \ - '--version[Show package version]' \ - \*{-p+,--property=}'[Show only properties by this name]:unit property' \ - {-a,--all}'[Show all properties, including empty ones]' \ + '(- *)'{-h,--help}'[Show help]' \ + '(- *)--version[Show package version]' \ + '*'{-p+,--property=}'[Show only properties by this name]:unit property' \ + '(-a --all)'{-a,--all}'[Show all properties, including empty ones]' \ '--kill-whom=[Whom to send signal to]:killwhom:(main control all)' \ - {-s+,--signal=}'[Which signal to send]:signal:_signals' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machine:_sd_machines' \ - {-l,--full}'[Do not ellipsize output]' \ + '(-s --signal)'{-s+,--signal=}'[Which signal to send]:signal:_signals' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machine:_sd_machines' \ + '(-l --full)'{-l,--full}'[Do not ellipsize output]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-legend[Do not show the headers and footers]' \ '--no-ask-password[Do not ask for system passwords]' \ - {-n+,--lines=}'[Number of journal entries to show]' \ - {-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \ + '(-n --lines)'{-n+,--lines=}'[Number of journal entries to show]' \ + '(-o --output)'{-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \ '*::loginctl command:_loginctl_commands' diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl index 2b675bd..99cc103 100644 --- a/shell-completion/zsh/_machinectl +++ b/shell-completion/zsh/_machinectl @@ -3,7 +3,12 @@ (( $+functions[__machinectl_get_images] )) || __machinectl_get_images () { - machinectl --no-legend list-images | {while read -r a b; do echo $a; done;} + local -a flags + if [[ $PREFIX == .* ]]; then flags=( --all ); fi + machinectl --no-legend list-images $flags | {while read -r a b; do + # escape : and \; do not interpret existing escape sequences + printf -- "%s\n" ${a//(#b)(\\|:)/\\$match} + done;} } (( $+functions[_machinectl_images] )) || @@ -12,9 +17,9 @@ _machines=("${(fo)$(__machinectl_get_images)}") typeset -U _machines if [[ -n "$_machines" ]]; then - _describe 'machines' _machines + _describe 'images' _machines else - _message 'no machines' + _message 'no images' fi } @@ -42,13 +47,22 @@ "list-images:Show available container and VM images" "image-status:Show image details" "show-image:Show properties of image" + "edit:Edit settings of one or more VMs/containers" + "cat:Show settings of one or more VMs/containers" "clone:Clone an image" "rename:Rename an image" "read-only:Mark or unmark image read-only" "remove:Remove an image" + "set-limits:Set image or pool size limit (disk quota)" + "clean:Remove hidden (or all) images" "pull-tar:Download a TAR container image" "pull-raw:Download a RAW container or VM image" + "import-tar:Import a local TAR container image" + "import-raw:Import a local RAW container or VM image" + "import-fs:Import a local directory container image" + "export-tar:Export a TAR container image locally" + "export-raw:Export a RAW container or VM image locally" "list-transfers:Show list of downloads in progress" "cancel-transfer:Cancel a download" ) @@ -57,50 +71,120 @@ _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@" else local curcontext="$curcontext" + local stop=0 cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}" - if (( $#cmd )); then - if (( CURRENT == 2 )); then - case $cmd in - list*|cancel-transfer|pull-tar|pull-raw) - msg="no options" ;; - clone) - _machinectl_images ;; - start) - _machinectl_images ;; - *) - _sd_machines - esac - else - case $cmd in - copy-to|copy-from|bind) - _files ;; - *) msg="no options" - esac - fi - else + case $cmd in + start|enable|disable) + _machinectl_images ;; + + status|show|poweroff|reboot|terminate|kill) + _sd_machines ;; + + login|shell) + if (( CURRENT == 2 )); then _sd_machines + else stop=1 + fi ;; + + copy-to|bind) + if (( CURRENT == 2 )); then _sd_machines + elif (( CURRENT == 3 )); then _files + elif (( CURRENT == 4 )); then _message "path on container" + else stop=1 + fi ;; + + copy-from) + if (( CURRENT == 2 )); then _sd_machines + elif (( CURRENT == 3 )); then _message "path on container" + elif (( CURRENT == 4 )); then _files + else stop=1 + fi ;; + + image-status|show-image|remove) + _machinectl_images ;; + + edit|cat) + if (( CURRENT == 2 )); then _machinectl_images + else stop=1 + fi ;; + + clone|rename) + if (( CURRENT == 2 )); then _machinectl_images + elif (( CURRENT == 3 )); then _message "target image" + else stop=1 + fi ;; + + read-only) + if (( CURRENT == 2 )); then _machinectl_images + elif (( CURRENT == 3 )); then _values 'read-only flag' 'true' 'false' + else stop=1 + fi ;; + + set-limit) + if (( CURRENT == 2 )); then _machinectl_images + elif (( CURRENT == 3 )); then _message "size limit" + else stop=1 + fi ;; + + pull-tar|pull-raw) + if (( CURRENT == 2 )); then _message "${cmd#pull-} file URL" + elif (( CURRENT == 3 )); then _message "target image" + else stop=1 + fi ;; + + import-tar) + if (( CURRENT == 2 )); then _files -g "*.(tar(|.(gz|bz2|xz|zst))|tgz|tbz2|txz|tzst)(.)" + elif (( CURRENT == 3 )); then _message "target image" + else stop=1 + fi ;; + import-raw) + if (( CURRENT == 2 )); then _files -g "*(.)" + elif (( CURRENT == 3 )); then _message "target image" + else stop=1 + fi ;; + import-fs) + if (( CURRENT == 2 )); then _files -/ + elif (( CURRENT == 3 )); then _message "target image" + else stop=1 + fi ;; + + export-tar|export-raw) + if (( CURRENT == 2 )); then _machinectl_images + elif (( CURRENT == 3 )); then _files + else stop=1 + fi ;; + + list*|clean|cancel-transfer) + stop=1 ;; + + '') + stop=1 ;; + esac + + if (( stop )); then _message "no more options" + return 1 fi fi } _arguments \ - {-h,--help}'[Prints a short help text and exits.]' \ - '--version[Prints a short version string and exits.]' \ + '(- *)'{-h,--help}'[Prints a short help text and exits.]' \ + '(- *)--version[Prints a short version string and exits.]' \ '--no-pager[Do not pipe output into a pager.]' \ '--no-legend[Do not show the headers and footers.]' \ '--no-ask-password[Do not ask for system passwords.]' \ - {-H+,--host=}'[Operate on remote host.]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container.]:machine:_sd_machines' \ - {-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \ - {-a,--all}'[Show all properties.]' \ - {-q,--quiet}'[Suppress output.]' \ - {-l,--full}'[Do not ellipsize cgroup members.]' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host.]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container.]:machine:_sd_machines' \ + '(-p --property)'{-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \ + '(-a --all)'{-a,--all}'[Show all properties.]' \ + '(-q --quiet)'{-q,--quiet}'[Suppress output.]' \ + '(-l --full)'{-l,--full}'[Do not ellipsize cgroup members.]' \ '--kill-whom=[Whom to send signal to.]:killwhom:(leader all)' \ - {-s+,--signal=}'[Which signal to send.]:signal:_signals' \ + '(-s --signal)'{-s+,--signal=}'[Which signal to send.]:signal:_signals' \ '--read-only[Create read-only bind mount.]' \ '--mkdir[Create directory before bind mounting, if missing.]' \ - {-n+,--lines=}'[Number of journal entries to show.]:integer' \ - {-o+,--output=}'[Change journal output mode.]:output modes:_sd_outputmodes' \ + '(-n --lines)'{-n+,--lines=}'[Number of journal entries to show.]:integer' \ + '(-o --output)'{-o+,--output=}'[Change journal output mode.]:output modes:_sd_outputmodes' \ '--verify=[Verification mode for downloaded images.]:verify:(no checksum signature)' \ '--force[Download image even if already exists.]' \ '*::machinectl command:_machinectl_commands' diff --git a/shell-completion/zsh/_networkctl b/shell-completion/zsh/_networkctl index c7d1e3a..6969797 100644 --- a/shell-completion/zsh/_networkctl +++ b/shell-completion/zsh/_networkctl @@ -49,12 +49,12 @@ } _arguments \ - {-a,--all}'[Show all links with status]' \ + '(-a --all)'{-a,--all}'[Show all links with status]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-legend[Do not print the column headers]' \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ - '--drop-in=[Use the given drop-in file name]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ + '--drop-in=[Use the given drop-in file name]:NAME' \ '--no-reload[Do not reload the network manager state when editing]' \ - '--json[Shows output formatted as JSON]:format:_networkctl_get_json' \ + '--json=[Shows output formatted as JSON]:format:_networkctl_get_json' \ '*::networkctl commands:_networkctl_commands' diff --git a/shell-completion/zsh/_oomctl b/shell-completion/zsh/_oomctl index 18e1938..ac7ec64 100644 --- a/shell-completion/zsh/_oomctl +++ b/shell-completion/zsh/_oomctl @@ -22,7 +22,7 @@ } _arguments \ - {-h,--help}'[Prints a short help text and exits.]' \ - '--version[Prints a short version string and exits.]' \ + '(- *)'{-h,--help}'[Prints a short help text and exits.]' \ + '(- *)--version[Prints a short version string and exits.]' \ '--no-pager[Do not pipe output into a pager]' \ '*::oomctl command:_oomctl_commands' diff --git a/shell-completion/zsh/_resolvectl b/shell-completion/zsh/_resolvectl index 25a518e..4ca469a 100644 --- a/shell-completion/zsh/_resolvectl +++ b/shell-completion/zsh/_resolvectl @@ -48,7 +48,9 @@ domain:"Configure per-interface search and route-only domains" flush-caches:"Flushes all DNS resource record caches the service maintains locally" llmnr:"Configure per-interface llmnr enabled status" + log-level:"Get/set logging threshold for systemd-resolved" mdns:"Configure per-interface mdns enabled status" + monitor:"Monitor DNS queries" nta:"Configure per-interface nta domains" openpgp:"Retrieve openpgp keys for an email" query:"Resolve domain names, IPv4 and IPv6 addresses" @@ -57,6 +59,7 @@ revert:"Revert the per-interfce DNS configuration" service:"Resolve DNS-SD and SRV services" show-cache:"Show the current cache contents" + show-server-state:"Show servers state" statistics:"Show resolver statistics" status:"Show the global and per-link DNS settings currently in effect" tlsa:"Query tlsa public keys stored as TLSA resource records" @@ -68,18 +71,27 @@ } _arguments \ - {-h,--help}'[Print a short help text and exit]' \ - '--version[Print a short version string and exit]' \ - '--legend=no[Do not show headers and footers]' \ + '(- *)'{-h,--help}'[Print a short help text and exit]' \ + '(- *)--version[Print a short version string and exit]' \ + '--legend=[Do not show headers and footers]:BOOL:(yes no)' \ '-4[Resolve IPv4 addresses]' \ '-6[Resolve IPv6 addresses]' \ - {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \ - {-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \ - {-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \ - {-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \ + '(-i --interface)'{-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \ + '(-p --protocol)'{-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \ + '(-t --type)'{-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \ + '(-c --class)'{-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \ '--service[Resolve services]' \ - '--service-address=no[Do not resolve address for services]' \ - '--service-txt=no[Do not resolve TXT records for services]' \ - '--cname=no[Do not follow CNAME redirects]' \ - '--search=no[Do not use search domains]' \ + '--service-address=[Do not resolve address for services]:BOOL:(yes no)' \ + '--service-txt=[Do not resolve TXT records for services]:BOOL:(yes no)' \ + '--cname=[Do not follow CNAME redirects]:BOOL:(yes no)' \ + '--validate=[Do not allow DNSSEC validation]:BOOL:(yes no)' \ + '--synthesize=[Do not allow synthetic response]:BOOL:(yes no)' \ + '--cache=[Do not allow response from cache]:BOOL:(yes no)' \ + '--stale-data=[Do not allow response from cache with stale data]:BOOL:(yes no)' \ + '--zone=[Do not allow response from locally registered mDNS/LLMNR records]:BOOL:(yes no)' \ + '--trust-anchor=[Do not allow response from local trust anchor]:BOOL:(yes no)' \ + '--network=[Do not allow response from network]:BOOL:(yes no)' \ + '--search=[Do not use search domains]:BOOL:(yes no)' \ + '--raw=[Dump the answer as binary data]:RAW:(payload packet)' \ + '--json=[Output as JSON]:JSON:(pretty short off)' \ '*::default: _resolvectl_commands' diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 54e34a1..df9045f 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -502,20 +502,20 @@ done # Use the last mode, or --system (they are exclusive and the last one is used). local _sys_service_mgr=${words[(R)(--user|--system)]:---system} _arguments -s \ - {-h,--help}'[Show help]' \ - '--version[Show package version]' \ - {-t+,--type=}'[List only units of a particular type]:unit type:_systemctl_unit_types' \ + '(- *)'{-h,--help}'[Show help]' \ + '(- *)--version[Show package version]' \ + '(-t --type)'{-t+,--type=}'[List only units of a particular type]:unit type:_systemctl_unit_types' \ '--state=[Display units in the specified state]:unit state:_systemctl_unit_states' \ '--job-mode=[Specify how to deal with other jobs]:mode:_systemctl_job_modes' \ - {-p+,--property=}'[Show only properties by specific name]:unit property:_systemctl_unit_properties' \ - {-a,--all}'[Show all units/properties, including dead/empty ones]' \ + '(-p --property)'{-p+,--property=}'[Show only properties by specific name]:unit property:_systemctl_unit_properties' \ + '(-a --all)'{-a,--all}'[Show all units/properties, including dead/empty ones]' \ '--reverse[Show reverse dependencies]' \ '--after[Show units ordered after]' \ '--before[Show units ordered before]' \ - {-l,--full}"[Don't ellipsize unit names on output]" \ + '(-l --full)'{-l,--full}"[Don't ellipsize unit names on output]" \ '--show-types[When showing sockets, show socket type]' \ '--check-inhibitors[Specify if inhibitors should be checked]:mode:_systemctl_check_inhibitors' \ - {-q,--quiet}'[Suppress output]' \ + '(-q --quiet)'{-q,--quiet}'[Suppress output]' \ '--no-warn[Suppress several warnings shown by default]' \ '--no-block[Do not wait until operation finished]' \ '--legend=no[Do not print a legend, i.e. the column headers and the footer with hints]' \ @@ -527,14 +527,14 @@ _arguments -s \ "--no-reload[When enabling/disabling unit files, don't reload daemon configuration]" \ '--no-ask-password[Do not ask for system passwords]' \ '--kill-whom=[Whom to send signal to]:killwhom:(main control all)' \ - {-s+,--signal=}'[Which signal to send]:signal:_signals' \ - {-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \ + '(-s --signal)'{-s+,--signal=}'[Which signal to send]:signal:_signals' \ + '(-f --force)'{-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \ '--root=[Enable/disable/mask unit files in the specified root directory]:directory:_directories' \ '--runtime[Enable/disable/mask unit files only temporarily until next reboot]' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-P,--privileged}'[Acquire privileges before execution]' \ - {-n+,--lines=}'[Journal entries to show]:number of entries' \ - {-o+,--output=}'[Change journal output mode]:modes:_sd_outputmodes' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-P --privileged)'{-P,--privileged}'[Acquire privileges before execution]' \ + '(-n --lines)'{-n+,--lines=}'[Journal entries to show]:number of entries' \ + '(-o --output)'{-o+,--output=}'[Change journal output mode]:modes:_sd_outputmodes' \ '--firmware-setup[Tell the firmware to show the setup menu on next boot]' \ '--plain[When used with list-dependencies, print output as a list]' \ '--failed[Show failed units]' \ diff --git a/shell-completion/zsh/_systemd b/shell-completion/zsh/_systemd index 8636315..eab7e0e 100644 --- a/shell-completion/zsh/_systemd +++ b/shell-completion/zsh/_systemd @@ -5,7 +5,7 @@ local curcontext="$curcontext" state lstate line case "$service" in systemd-ask-password) _arguments \ - {-h,--help}'[Show this help]' \ + '(- *)'{-h,--help}'[Show this help]' \ '--icon=[Icon name]:icon name:' \ '--timeout=[Timeout in sec]:timeout (seconds):' \ '--no-tty[Ask question via agent even on TTY]' \ @@ -14,53 +14,54 @@ case "$service" in ;; systemd-cat) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version.]' \ - {-t+,--identifier=}'[Set syslog identifier.]:syslog identifier:' \ - {-p+,--priority=}'[Set priority value.]:value:({0..7})' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version.]' \ + '(-t --identifier)'{-t+,--identifier=}'[Set syslog identifier.]:syslog identifier:' \ + '(-p --priority)'{-p+,--priority=}'[Set priority value.]:value:({0..7})' \ '--level-prefix=[Control whether level prefix shall be parsed.]:boolean:(1 0)' \ - ':Message' + '--namespace=[Connect to specified journal namespace.]:journal namespace:' + _precommand ;; systemd-cgls) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ '--no-pager[Do not pipe output into a pager]' \ - {-a,--all}'[Show all groups, including empty]' \ + '(-a --all)'{-a,--all}'[Show all groups, including empty]' \ '-k[Include kernel threads in output]' \ ':cgroups:(cpuset cpu cpuacct memory devices freezer blkio)' ;; systemd-cgtop) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Print version and exit]' \ + '(-)'{-h,--help}'[Show this help]' \ + '(-)--version[Print version and exit]' \ '(-c -m -i -t)-p[Order by path]' \ '(-c -p -m -i)-t[Order by number of tasks]' \ '(-m -p -i -t)-c[Order by CPU load]' \ '(-c -p -i -t)-m[Order by memory load]' \ '(-c -m -p -t)-i[Order by IO load]' \ - {-d+,--delay=}'[Specify delay]:delay:' \ - {-n+,--iterations=}'[Run for N iterations before exiting]:number of iterations:' \ - {-b,--batch}'[Run in batch mode, accepting no input]' \ + '(-d --delay)'{-d+,--delay=}'[Specify delay]:delay:' \ + '(-n --iterations)'{-n+,--iterations=}'[Run for N iterations before exiting]:number of iterations:' \ + '(-b --batch)'{-b,--batch}'[Run in batch mode, accepting no input]' \ '--depth=[Maximum traversal depth]:maximum depth:' ;; systemd-detect-virt) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ - {-c,--container}'[Only detect whether we are run in a container]' \ - {-v,--vm}'[Only detect whether we are run in a VM]' \ - {-q,--quiet}"[Don't output anything, just set return value]" + '(-)'{-h,--help}'[Show this help]' \ + '(-)--version[Show package version]' \ + '(-c --container)'{-c,--container}'[Only detect whether we are run in a container]' \ + '(-v --vm)'{-v,--vm}'[Only detect whether we are run in a VM]' \ + '(-q --quiet)'{-q,--quiet}"[Don't output anything, just set return value]" ;; systemd-machine-id-setup) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' + '(-)'{-h,--help}'[Show this help]' \ + '(-)--version[Show package version]' ;; systemd-notify) _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(-)'{-h,--help}'[Show this help]' \ + '(-)--version[Show package version]' \ '--ready[Inform the init system about service start-up completion.]' \ '--pid=[Inform the init system about the main PID of the daemon]:daemon main PID:_pids' \ '--status=[Send a free-form status string for the daemon to the init systemd]:status string:' \ @@ -68,9 +69,9 @@ case "$service" in ;; systemd-tty-ask-password-agent) _arguments \ - {-h,--help}'[Prints a short help text and exits.]' \ - '--version[Prints a short version string and exits.]' \ - '--list[Lists all currently pending system password requests.]' \ + '(-)'{-h,--help}'[Prints a short help text and exits.]' \ + '(-)--version[Prints a short version string and exits.]' \ + '--list[Lists all currently pending system password requests.]' \ '--query[Process all currently pending system password requests by querying the user on the calling TTY.]' \ '--watch[Continuously process password requests.]' \ '--wall[Forward password requests to wall(1).]' \ diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze index 2e046ea..20b8964 100644 --- a/shell-completion/zsh/_systemd-analyze +++ b/shell-completion/zsh/_systemd-analyze @@ -94,8 +94,8 @@ JSON or table format' } _arguments \ - {-h,--help}'[Show help text]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show help text]' \ + '(- *)--version[Show package version]' \ '--system[Operate on system systemd instance]' \ '--user[Operate on user systemd instance]' \ '--global[Show global user instance config]' \ @@ -117,7 +117,7 @@ _arguments \ '--fuzz=[When printing the tree of the critical chain, print also services, which finished TIMESPAN earlier, than the latest in the branch]:TIMESPAN' \ '--from-pattern=[When generating a dependency graph, filter only origins]:GLOB' \ '--to-pattern=[When generating a dependency graph, filter only destinations]:GLOB' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machine:_sd_machines' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machine:_sd_machines' \ '--quiet[Do not show hints]' \ '*::systemd-analyze commands:_systemd-analyze_commands' diff --git a/shell-completion/zsh/_systemd-delta b/shell-completion/zsh/_systemd-delta index 7d7456b..efcec8b 100644 --- a/shell-completion/zsh/_systemd-delta +++ b/shell-completion/zsh/_systemd-delta @@ -9,8 +9,8 @@ _systemd-delta_types() { } _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- :)'{-h,--help}'[Show this help]' \ + '(- :)--version[Show package version]' \ '--no-pager[Do not pipe output into a pager]' \ '--diff=[Show a diff when overridden files differ]:boolean:(1 0)' \ {-t+,--type=}'[Only display a selected set of override types]:types:_systemd-delta_types' \ diff --git a/shell-completion/zsh/_systemd-inhibit b/shell-completion/zsh/_systemd-inhibit index 059ef9e..08bcf42 100644 --- a/shell-completion/zsh/_systemd-inhibit +++ b/shell-completion/zsh/_systemd-inhibit @@ -26,8 +26,10 @@ _systemd-inhibit_what() { } _arguments \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ + '--no-pager[Do not pipe output into a pager]' \ + '--no-legend[Do not show the headers and footers]' \ '--what=[Operations to inhibit]:options:_systemd-inhibit_what' \ '--who=[A descriptive string who is inhibiting]:who is inhibiting:' \ '--why=[A descriptive string why is being inhibited]:reason for the lock:' \ diff --git a/shell-completion/zsh/_systemd-nspawn b/shell-completion/zsh/_systemd-nspawn index adc5d7c..a9856b5 100644 --- a/shell-completion/zsh/_systemd-nspawn +++ b/shell-completion/zsh/_systemd-nspawn @@ -13,27 +13,27 @@ _systemd-nspawn_caps(){ } _arguments \ - {-h,--help}'[Show this help.]' \ - '--version[Print a short version string and exit.]' \ - {--quiet,-q}'[Turns off any status output by the tool itself.]' \ - {--directory=,-D+}'[Directory to use as file system root for the namespace container. If omitted the current directory will be used.]:directories:_directories' \ + '(- *)'{-h,--help}'[Show this help.]' \ + '(- *)--version[Print a short version string and exit.]' \ + '(--quiet -q)'{--quiet,-q}'[Turns off any status output by the tool itself.]' \ + '(--directory -D)'{--directory=,-D+}'[Directory to use as file system root for the namespace container. If omitted the current directory will be used.]:directories:_directories' \ '--template=[Initialize root directory from template directory, if missing.]:template:_directories' \ - {--ephemeral,-x}'[Run container with snapshot of root directory, and remove it after exit.]' \ - {--image=,-i+}'[Disk image to mount the root directory for the container from.]:disk image: _files' \ - {--boot,-b}'[Automatically search for an init binary and invoke it instead of a shell or a user supplied program.]' \ - {--user=,-u+}'[Run the command under specified user, create home directory and cd into it.]:user:_users' \ - {--machine=,-M+}'[Sets the machine name for this container.]: : _message "container name"' \ + '(--ephemeral -x)'{--ephemeral,-x}'[Run container with snapshot of root directory, and remove it after exit.]' \ + '(--image -i)'{--image=,-i+}'[Disk image to mount the root directory for the container from.]:disk image: _files' \ + '(--boot -b)'{--boot,-b}'[Automatically search for an init binary and invoke it instead of a shell or a user supplied program.]' \ + '(--user -u)'{--user=,-u+}'[Run the command under specified user, create home directory and cd into it.]:user:_users' \ + '(--machine -M)'{--machine=,-M+}'[Sets the machine name for this container.]: : _message "container name"' \ '--uuid=[Set the specified uuid for the container.]: : _message "container UUID"' \ - {--slice=,-S+}'[Make the container part of the specified slice, instead of the default machine.slice.]: : _message slice' \ + '(--slice -S)'{--slice=,-S+}'[Make the container part of the specified slice, instead of the default machine.slice.]: : _message slice' \ '--private-network[Disconnect networking of the container from the host.]' \ '--network-interface=[Assign the specified network interface to the container.]: : _net_interfaces' \ '--network-macvlan=[Create a "macvlan" interface of the specified Ethernet network interface and add it to the container.]: : _net_interfaces' \ '--network-ipvlan=[Create an "ipvlan" network interface based on an existing network interface to the container.]: : _net_interfaces' \ - {--network-veth,-n}'[Create a virtual Ethernet link (veth) between host and container.]' \ + '(--network-veth -n)'{--network-veth,-n}'[Create a virtual Ethernet link (veth) between host and container.]' \ '--network-bridge=[Adds the host side of the Ethernet link created with --network-veth to the specified bridge.]: : _net_interfaces' \ - {--port=,-p+}'[Expose a container IP port on the host.]: : _message port' \ - {--selinux-context=,-Z+}'[Sets the SELinux security context to be used to label processes in the container.]: : _message "SELinux context"' \ - {--selinux-apifs-context=,-L+}'[Sets the SELinux security context to be used to label files in the virtual API file systems in the container.]: : _message "SELinux context"' \ + '(--port -p)'{--port=,-p+}'[Expose a container IP port on the host.]: : _message port' \ + '(--selinux-context -Z)'{--selinux-context=,-Z+}'[Sets the SELinux security context to be used to label processes in the container.]: : _message "SELinux context"' \ + '(--selinux-apifs-context -L)'{--selinux-apifs-context=,-L+}'[Sets the SELinux security context to be used to label files in the virtual API file systems in the container.]: : _message "SELinux context"' \ '--capability=[List one or more additional capabilities to grant the container.]:capabilities:_systemd-nspawn_caps' \ '--drop-capability=[Specify one or more additional capabilities to drop for the containerm]:capabilities:_systemd-nspawn_caps' \ "--link-journal=[Control whether the container's journal shall be made visible to the host system.]:options:(no host guest auto)" \ diff --git a/shell-completion/zsh/_systemd-path b/shell-completion/zsh/_systemd-path index d1fb24b..58e46a2 100644 --- a/shell-completion/zsh/_systemd-path +++ b/shell-completion/zsh/_systemd-path @@ -3,7 +3,7 @@ typeset -A sdpath=( ${$(systemd-path)/:/} ) _arguments -S \ - '(-h --help)'{-h,--help}'[Print help text and exit]' \ - '(-v --version)'{-v,--version}'[Print a version string and exit]' \ - '--suffix=[Append a suffix to the paths]' \ + '(- *)'{-h,--help}'[Print help text and exit]' \ + '(- *)'{-v,--version}'[Print a version string and exit]' \ + '--suffix=[Append a suffix to the paths]:SUFFIX' \ '*:pathname:compadd -k sdpath' diff --git a/shell-completion/zsh/_systemd-run b/shell-completion/zsh/_systemd-run index 7568ed4..d3ec2e2 100644 --- a/shell-completion/zsh/_systemd-run +++ b/shell-completion/zsh/_systemd-run @@ -23,12 +23,12 @@ __systemctl() { } _arguments \ - {-G,--collect}'[Unload the transient unit after it completed]' \ + '(-G --collect)'{-G,--collect}'[Unload the transient unit after it completed]' \ '--description=[Description for unit]:description' \ '--gid=[Run as system group]:group:_groups' \ - {-h,--help}'[Show help message]' \ - {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ + '(- *)'{-h,--help}'[Show help message]' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '--nice=[Nice level]:nice level' \ '--no-ask-password[Do not query the user for authentication]' \ '--no-block[Do not synchronously wait for the unit start operation to finish]' \ @@ -41,8 +41,8 @@ _arguments \ '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \ '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \ '--path-property=[Set path unit property]:NAME=VALUE' \ - {-P,--pipe}'[Inherit standard input, output, and error]' \ - {-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ + '(-P --pipe)'{-P,--pipe}'[Inherit standard input, output, and error]' \ + '(-p --property)'{-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \ SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \ DevicePolicy= KillMode= ExitType= DeviceAllow= BlockIOReadBandwidth= \ @@ -57,22 +57,22 @@ _arguments \ ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \ ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \ ))' \ - {-t,--pty}'[The service connects to the terminal]' \ - {-q,--quiet}'[Suppresses additional informational output]' \ - {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ - {-d,--same-dir}'[Run on the current working directory]' \ + '(-t --pty)'{-t,--pty}'[The service connects to the terminal]' \ + '(-q --quiet)'{-q,--quiet}'[Suppresses additional informational output]' \ + '(-r --remain-after-exit)'{-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ + '(-d --same-dir)'{-d,--same-dir}'[Run on the current working directory]' \ '--scope[Run this as scope rather than service]' \ '--send-sighup[Send SIGHUP when terminating]' \ '--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \ - {-E+,--setenv=}'[Set environment]:NAME=VALUE' \ - {-S,--shell}'[requests an interactive shell in the current working directory]' \ + '(-E --setenv)'{-E+,--setenv=}'[Set environment]:NAME=VALUE' \ + '(-S --shell)'{-S,--shell}'[requests an interactive shell in the current working directory]' \ '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \ '--slice-inherit[Run in the inherited slice]' \ '--socket-property=[Set socket unit property]:NAME=VALUE' \ '--system[Run as system unit]' \ '--timer-property=[Set timer unit property]:NAME=VALUE' \ '--uid=[Run as system user]:user:_users' \ - {-u+,--unit=}'[Run under the specified unit name]:unit name' \ + '(-u --unit)'{-u+,--unit=}'[Run under the specified unit name]:unit name' \ '--user[Run as user unit]' \ '--version[Show package version]' \ '--wait=[Wait until service stopped again]' \ diff --git a/shell-completion/zsh/_systemd-tmpfiles b/shell-completion/zsh/_systemd-tmpfiles index 6c9094a..3160148 100644 --- a/shell-completion/zsh/_systemd-tmpfiles +++ b/shell-completion/zsh/_systemd-tmpfiles @@ -2,13 +2,22 @@ # SPDX-License-Identifier: LGPL-2.1-or-later _arguments \ - {-h,--help}'[Show help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show help]' \ + '--user[Execute user configuration]' \ + '(- *)--version[Show package version]' \ + '--cat-config[Show configuration files]' \ + '--tldr[Show non-comment parts of configuration]' \ '--create[Create, set ownership/permissions based on the config files.]' \ '--clean[Clean up all files and directories with an age parameter configured.]' \ '--remove[All files and directories marked with r, R in the configuration files are removed.]' \ '--boot[Execute actions only safe at boot]' \ - '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \ - '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \ + '--graceful[Quietly ignore unknown users or groups]' \ + '--prefix=[Only apply rules that apply to paths with the specified prefix.]:PATH' \ + '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]:PATH' \ + '-E[Ignore rules prefixed with /dev, /proc, /run, /sys]' \ '--root=[Operate on an alternate filesystem root]:directory:_directories' \ + '--image=[Operate on disk image as filesystem root]:image' \ + '--image-policy=[Specify disk image dissection policy]:policy' \ + '--replace=[Treat arguments as replacement for PATH]:PATH' \ + '--no-pager[Do not pipe output into a pager]' \ '*::files:_files' diff --git a/shell-completion/zsh/_timedatectl b/shell-completion/zsh/_timedatectl index 2467b80..938fa87 100644 --- a/shell-completion/zsh/_timedatectl +++ b/shell-completion/zsh/_timedatectl @@ -59,11 +59,11 @@ _timedatectl_command(){ } _arguments -s \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ + '(- *)'{-h,--help}'[Show this help]' \ + '(- *)--version[Show package version]' \ '--adjust-system-clock[Adjust system clock when changing local RTC mode]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-ask-password[Do not prompt for password]' \ - {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ - {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ + '(-H --host)'{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ + '(-M --machine)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '*::timedatectl commands:_timedatectl_command' diff --git a/shell-completion/zsh/_udevadm b/shell-completion/zsh/_udevadm index 6d31398..9ff87d8 100644 --- a/shell-completion/zsh/_udevadm +++ b/shell-completion/zsh/_udevadm @@ -4,6 +4,8 @@ (( $+functions[_udevadm_info] )) || _udevadm_info(){ _arguments \ + '(-)'{-h,--help}'[Print help]' \ + '(-)'{-V,--version}'[Print version of the program]' \ '--query=[Query the database for specified type of device data. It needs the --path or --name to identify the specified device.]:type:(name symlink path property all)' \ '--path=[The devpath of the device to query.]:sys files:_files -P /sys/ -W /sys' \ '--name=[The name of the device node or a symlink to query]:device files:_files -P /dev/ -W /dev' \ @@ -15,73 +17,76 @@ _udevadm_info(){ '--export-db[Export the content of the udev database.]' \ '--cleanup-db[Cleanup the udev database.]' \ '--value[When showing properties, print only their values.]' \ - '--property=[Show only properties by this name.]' + '--property=[Show only properties by this name.]:NAME' } (( $+functions[_udevadm_trigger] )) || _udevadm_trigger(){ _arguments \ + '(-)'{-h,--help}'[Show help]' \ + '(-)'{-V,--version}'[Show package version]' \ '--verbose[Print the list of devices which will be triggered.]' \ '--dry-run[Do not actually trigger the event.]' \ '--quiet[Suppress error logging in triggering events.]' \ '--type=[Trigger a specific type of devices.]:types:(all devices subsystems failed)' \ '--action=[Type of event to be triggered.]:actions:(add change remove move online offline bind unbind)' \ - '--subsystem-match=[Trigger events for devices which belong to a matching subsystem.]' \ - '--subsystem-nomatch=[Do not trigger events for devices which belong to a matching subsystem.]' \ - '--attr-match=attribute=[Trigger events for devices with a matching sysfs attribute.]' \ - '--attr-nomatch=attribute=[Do not trigger events for devices with a matching sysfs attribute.]' \ - '--property-match=[Trigger events for devices with a matching property value.]' \ - '--tag-match=property[Trigger events for devices with a matching tag.]' \ - '--sysname-match=[Trigger events for devices with a matching sys device name.]' \ - '--parent-match=[Trigger events for all children of a given device.]' \ + '--subsystem-match=[Trigger events for devices which belong to a matching subsystem.]:SUBSYSTEM' \ + '--subsystem-nomatch=[Do not trigger events for devices which belong to a matching subsystem.]:SUBSYSTEM' \ + '--attr-match=attribute=[Trigger events for devices with a matching sysfs attribute.]:FILE' \ + '--attr-nomatch=attribute=[Do not trigger events for devices with a matching sysfs attribute.]:FILE' \ + '--property-match=[Trigger events for devices with a matching property value.]:KEY=VALUE' \ + '--tag-match=[Trigger events for devices with a matching tag.]:TAG' \ + '--sysname-match=[Trigger events for devices with a matching sys device name.]:NAME' \ + '--parent-match=[Trigger events for all children of a given device.]:NAME' \ '--initialized-match[Trigger events for devices that are already initialized.]' \ '--initialized-nomatch[Trigger events for devices that are not initialized yet.]' \ '--uuid[Print synthetic uevent UUID.]' \ - '--prioritized-subsystem=[Trigger events for devices which belong to a matching subsystem earlier.]' + '--prioritized-subsystem=[Trigger events for devices which belong to a matching subsystem earlier.]:SUBSYSTEM' } (( $+functions[_udevadm_settle] )) || _udevadm_settle(){ _arguments \ - '--timeout=[Maximum number of seconds to wait for the event queue to become empty.]' \ - '--seq-start=[Wait only for events after the given sequence number.]' \ - '--seq-end=[Wait only for events before the given sequence number.]' \ - '--exit-if-exists=[Stop waiting if file exists.]:files:_files' \ - '--quiet[Do not print any output, like the remaining queue entries when reaching the timeout.]' \ - '--help[Print help text.]' + '(-)'{-h,--help}'[Print help]' \ + '(-)'{-V,--version}'[Print version of the program]' \ + '(-t --timeout)'{-t,--timeout=}'[Maximum number of seconds to wait for the event queue to become empty.]:SEC' \ + '(-E --exit-if-exists)'{-E,--exit-if-exists=}'[Stop waiting if file exists.]:files:_files' } (( $+functions[_udevadm_control] )) || _udevadm_control(){ _arguments \ - '--exit[Signal and wait for systemd-udevd to exit.]' \ - '--log-priority=[Set the internal log level of systemd-udevd.]:priorities:(err info debug)' \ - '--stop-exec-queue[Signal systemd-udevd to stop executing new events. Incoming events will be queued.]' \ - '--start-exec-queue[Signal systemd-udevd to enable the execution of events.]' \ - '--reload[Signal systemd-udevd to reload the rules files and other databases like the kernel module index.]' \ - '--property=[Set a global property for all events.]' \ - '--children-max=[Set the maximum number of events.]' \ - '--timeout=[The maximum number of seconds to wait for a reply from systemd-udevd.]' \ - '--help[Print help text.]' + '(-)'{-h,--help}'[Show help]' \ + '(-)'{-V,--version}'[Show package version]' \ + '(-e --exit)'{-e,--exit}'[Signal and wait for systemd-udevd to exit.]' \ + '(-l --log-level)'{-l,--log-level=}'[Set the internal log level of systemd-udevd.]:LEVEL:(err info debug)' \ + '(-s --stop-exec-queue)'{-s,--stop-exec-queue}'[Signal systemd-udevd to stop executing new events. Incoming events will be queued.]' \ + '(-S --start-exec-queue)'{-S,--start-exec-queue}'[Signal systemd-udevd to enable the execution of events.]' \ + '(-R --reload)'{-R,--reload}'[Signal systemd-udevd to reload the rules files and other databases like the kernel module index.]' \ + '(-p --property)'{-p,--property=}'[Set a global property for all events.]:KEY=VALUE' \ + '(-m --children-max=)'{-m,--children-max=}'[Set the maximum number of events.]:N' \ + '(-t --timeout=)'{-t,--timeout=}'[The maximum number of seconds to wait for a reply from systemd-udevd.]:SECONDS' } (( $+functions[_udevadm_monitor] )) || _udevadm_monitor(){ _arguments \ - '--kernel[Print the kernel uevents.]' \ - '--udev[Print the udev event after the rule processing.]' \ - '--property[Also print the properties of the event.]' \ - '--subsystem-match=[Filter events by subsystem/\[devtype\].]' \ - '--tag-match=[Filter events by property.]' \ - '--help[Print help text.]' + '(-)'{-h,--help}'[Show help]' \ + '(-)'{-V,--version}'[Show package version]' \ + '(-k --kernel)'{-k,--kernel}'[Print the kernel uevents.]' \ + '(-u --udev)'{-u,--udev}'[Print the udev event after the rule processing.]' \ + '(-p --property)'{-p,--property}'[Also print the properties of the event.]' \ + '(-s --subsystem-match)'{-s,--subsystem-match=}'[Filter events by subsystem/\[devtype\].]:SUBSYSTEM' \ + '(-t --tag-match)'{-t,--tag-match=}'[Filter events by property.]:TAG' } (( $+functions[_udevadm_test] )) || _udevadm_test(){ _arguments \ + '(-)'{-h,--help}'[Show help]' \ + '(-)'{-V,--version}'[Show package version]' \ '--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \ '--subsystem=[The subsystem string.]' \ - '--help[Print help text.]' \ '*::devpath:_files -P /sys/ -W /sys' } @@ -89,51 +94,55 @@ _udevadm_test(){ _udevadm_test-builtin(){ if (( CURRENT == 2 )); then _arguments \ + '(- *)'{-h,--help}'[Print help]' \ + '(- *)'{-V,--version}'[Print version of the program]' \ '--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \ - '--help[Print help text]' \ '*::builtins:(blkid btrfs hwdb input_id net_id net_setup_link kmod path_id usb_id uaccess)' elif (( CURRENT == 3 )); then _arguments \ '--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \ - '--help[Print help text]' \ + '(- *)--help[Print help text]' \ '*::syspath:_files -P /sys -W /sys' else _arguments \ '--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \ - '--help[Print help text]' + '(- *)--help[Print help text]' fi } (( $+functions[_udevadm_verify] )) || _udevadm_verify(){ _arguments \ - {-N+,--resolve-names=}'[When to resolve names.]:resolve:(early never)' \ + '(- *)'{-h,--help}'[Show help]' \ + '(- *)'{-V,--version}'[Show package version]' \ + '(-N --resolve-names)'{-N+,--resolve-names=}'[When to resolve names.]:resolve:(early never)' \ '--root=[Operate on catalog hierarchy under specified directory]:directories:_directories' \ - {--no-summary}'[Do not show summary.]' \ - {--no-style}'[Ignore style issues.]' \ - {-h,--help}'[Print help text.]' \ + --no-summary'[Do not show summary.]' \ + --no-style'[Ignore style issues.]' \ '*::files:_files' } (( $+functions[_udevadm_wait] )) || _udevadm_wait(){ _arguments \ - '--timeout=[Maximum number of seconds to wait for the devices being created.]' \ + '(- *)'{-h,--help}'[Print help]' \ + '(- *)'{-V,--version}'[Print version of the program]' \ + '--timeout=[Maximum number of seconds to wait for the devices being created.]:SEC' \ '--initialized=[Wait for devices being initialized by systemd-udevd.]:boolean:(yes no)' \ '--removed[Wait for devices being removed.]' \ '--settle[Also wait for udev queue being empty.]' \ - '--help[Print help text.]' \ '*::devpath:_files -P /dev/ -W /dev' } (( $+functions[_udevadm_lock] )) || _udevadm_lock(){ _arguments \ - '--timeout=[Maximum number of seconds to wait for the devices being locked.]' \ - '--device=[Block device to lock.]' \ - '--backing=[File whose backing block device to lock.]' \ - '--print[Only show which block device the lock would be taken on.]' \ - '--help[Print help text.]' + '(- *)'{-h,--help}'[Print help]' \ + '(- *)'{-V,--version}'[Print version of the program]' \ + '(-t --timeout)'{-t,--timeout=}'[Maximum number of seconds to wait for the devices being locked.]:SECS' \ + '(-d --device)'{-d,--device=}'[Block device to lock.]:DEVICE' \ + '(-b --backing)'{-b,--backing=}'[File whose backing block device to lock.]:FILE' \ + '(-p --print)'{-p,--print}'[Only show which block device the lock would be taken on.]' } (( $+functions[_udevadm_mounts] )) || @@ -189,6 +198,6 @@ _udevadm_commands(){ _arguments \ '--debug[Print debug messages to stderr]' \ - '--version[Print version number]' \ - '--help[Print help text]' \ + '(- *)--version[Print version number]' \ + '(- *)--help[Print help text]' \ '*::udevadm commands:_udevadm_commands' |