aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-02-19 18:46:44 +0100
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-03-06 23:05:24 -0800
commit8c41a053feee045049f4381bb59bd0817d0cc0ef (patch)
tree8239334c09c7942dc453ead78f7e79290344698b /share
parenta1b3358cb8666d1dc2cac9edebc56731ee2aba35 (diff)
systemctl completions: Show options for --property=
Inspired by the official bash completion, this uses systemd --dump-configuration-items.
Diffstat (limited to 'share')
-rw-r--r--share/completions/systemctl.fish13
1 files changed, 12 insertions, 1 deletions
diff --git a/share/completions/systemctl.fish b/share/completions/systemctl.fish
index cbda5e7c..b57bf567 100644
--- a/share/completions/systemctl.fish
+++ b/share/completions/systemctl.fish
@@ -4,6 +4,17 @@ set -l commands list-units list-sockets start stop reload restart try-restart re
list-dependencies snapshot delete daemon-reload daemon-reexec show-environment set-environment unset-environment \
default rescue emergency halt poweroff reboot kexec exit suspend hibernate hybrid-sleep switch-root
+function __fish_systemd_properties
+ if type -q /usr/lib/systemd/systemd
+ set IFS "="
+ /usr/lib/systemd/systemd --dump-configuration-items | while read key value
+ if not test -z $value
+ echo $key
+ end
+ end
+ end
+end
+
complete -f -e -c systemctl
# All systemctl commands
complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a "$commands"
@@ -52,7 +63,7 @@ complete -f -c systemctl -n "__fish_seen_subcommand_from set-default" -a '(__fis
complete -f -c systemctl -s t -l type -d 'List of unit types' -xa 'help service, mount, socket, target,'
complete -f -c systemctl -l state -d 'List of unit states' -xa 'LOAD, SUB, ACTIVE,'
-complete -f -c systemctl -s p -l property -d 'Properties displayed in the "show" command'
+complete -f -c systemctl -s p -l property -d 'Properties displayed in the "show" command' -a '(__fish_systemd_properties)'
complete -f -c systemctl -s a -l all -d 'Show all units or properties'
complete -f -c systemctl -s r -l recursive -d 'Show also units of local containers'
complete -f -c systemctl -l reverse -d 'Show reverse dependencies between units'