diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2024-01-11 18:26:12 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2024-01-11 18:35:37 +0100 |
commit | 45a3c0256404f3f180ec9d8611c818545395292c (patch) | |
tree | 4617b01ffb6d26601ca0e514b274683b044cfc7d /shell-completion/bash | |
parent | id128: add --no-pager, --no-legend, --json=/-j switches to systemd-id128 tool (diff) | |
download | systemd-45a3c0256404f3f180ec9d8611c818545395292c.tar.xz systemd-45a3c0256404f3f180ec9d8611c818545395292c.zip |
shell-completion: add new systemd-id128 options
Diffstat (limited to 'shell-completion/bash')
-rw-r--r-- | shell-completion/bash/systemd-id128 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/shell-completion/bash/systemd-id128 b/shell-completion/bash/systemd-id128 index 1c196391c8..74ea1016a9 100644 --- a/shell-completion/bash/systemd-id128 +++ b/shell-completion/bash/systemd-id128 @@ -28,12 +28,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 +44,9 @@ _systemd_id128() { --app-specific|-a) comps="" ;; + --json) + comps="short pretty off" + ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 @@ -65,6 +69,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") ) |