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/bash/systemd-run | |
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/bash/systemd-run')
-rw-r--r-- | shell-completion/bash/systemd-run | 29 |
1 files changed, 16 insertions, 13 deletions
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) |