summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-28 01:38:51 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-28 01:38:51 +0200
commitc1c743b871fad6a80dc35778f2af0e9395899b84 (patch)
tree3983c7e4a90140f6ff2053da01c45c4d46df1a86
parentedb75140b5a73791ae4fdc3ef977118ec6aa46fc (diff)
parent20bde8192332cff5a2fcf7059a4b48b9fca75e63 (diff)
Merge pull request #1059 from evverx/systemd-run-bash-completion
shell-completion: update systemd-run bash completion
-rw-r--r--shell-completion/bash/systemd-run15
1 files changed, 13 insertions, 2 deletions
diff --git a/shell-completion/bash/systemd-run b/shell-completion/bash/systemd-run
index 712655caf4..63c831b8f1 100644
--- a/shell-completion/bash/systemd-run
+++ b/shell-completion/bash/systemd-run
@@ -34,10 +34,16 @@ _systemd_run() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local OPTS='-h --help --version --user --system --scope --unit --description --slice
-r --remain-after-exit --send-sighup -H --host -M --machine --service-type
+ --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive
+ --on-calendar --timer-property -t --pty -q --quiet --no-block
--uid --gid --nice --setenv -p --property'
local mode=--system
local i
+ local opts_with_values=(
+ --unit --description --slice --service-type -H --host -M --machine -p --property --on-active
+ --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar --timer-property
+ )
for (( i=1; i <= COMP_CWORD; i++ )); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
local root_command=${COMP_WORDS[i]}
@@ -47,11 +53,11 @@ _systemd_run() {
[[ ${COMP_WORDS[i]} == "--user" ]] && mode=--user
- [[ $i -lt $COMP_CWORD && ${COMP_WORDS[i]} == @(--unit|--description|--slice|--service-type|-H|--host|-M|--machine|-p|--property) ]] && ((i++))
+ [[ $i -lt $COMP_CWORD && " ${opts_with_values[@]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++))
done
case "$prev" in
- --unit|--description)
+ --unit|--description|--on-active|--on-boot|--on-startup|--on-unit-active|--on-unit-inactive|--on-calendar)
# argument required but no completions available
return
;;
@@ -92,6 +98,11 @@ _systemd_run() {
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
;;
+ --timer-property)
+ local comps='AccuracySec= WakeSystem='
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+ ;;
esac
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )