summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-27 21:34:28 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-27 22:34:28 -0400
commit1cf3c30c0787f941b0f6d0b11ab504ddee3b0b8f (patch)
tree4b559e0f624fff741a112eda77ba91df1d4b4593 /shell-completion
parent7c67f0f71a2a4e64264e925977645e306816a3ab (diff)
shell-completion: systemctl set-default,get-default,is-system-running
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemctl.in3
-rw-r--r--shell-completion/zsh/_systemctl.in16
2 files changed, 15 insertions, 4 deletions
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index 8c1ecd486..1c44a8df0 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -148,7 +148,8 @@ _systemctl () {
[STANDALONE]='daemon-reexec daemon-reload default
emergency exit halt hibernate hybrid-sleep kexec list-jobs
list-sockets list-timers list-units list-unit-files poweroff
- reboot rescue show-environment suspend get-default'
+ reboot rescue show-environment suspend get-default
+ is-system-running'
[NAME]='snapshot'
[FILE]='link'
[TARGETS]='set-default'
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 1435dee72..44981fe85 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -31,6 +31,9 @@
"disable:Disable one or more unit files"
"reenable:Reenable one or more unit files"
"preset:Enable/disable one or more unit files based on preset configuration"
+ "set-default:Set the default target"
+ "get-default:Query the default target"
+ "is-system-running:Query overall status of the system"
"help:Show documentation for specified units"
"list-dependencies:Show unit dependency tree"
"mask:Mask one or more units"
@@ -237,21 +240,28 @@ done
(( $+functions[_systemctl_unmask] )) || _systemctl_unmask()
{
_systemctl_masked_units
- compadd "$@" -a - _sys_masked_units || _message "no masked unit found"
+ compadd "$@" -a - _sys_masked_units || _message "no masked units found"
}
# Completion functions for JOBS
(( $+functions[_systemctl_cancel] )) || _systemctl_cancel()
{
compadd "$@" - $(__systemctl list-jobs \
- | cut -d' ' -f1 2>/dev/null ) || _message "no job found"
+ | cut -d' ' -f1 2>/dev/null ) || _message "no jobs found"
}
# Completion functions for SNAPSHOTS
(( $+functions[_systemctl_delete] )) || _systemctl_delete()
{
compadd "$@" - $(__systemctl list-units --type snapshot --all \
- | cut -d' ' -f1 2>/dev/null ) || _message "no snapshot found"
+ | cut -d' ' -f1 2>/dev/null ) || _message "no snapshots found"
+}
+
+# Completion functions for TARGETS
+(( $+functions[_systemctl_set-default] )) || _systemctl_set-default()
+{
+ compadd "$@" - $(__systemctl list-unit-files --type target --all \
+ | cut -d' ' -f1 2>/dev/null ) || _message "no targets found"
}
# Completion functions for ENVS