]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bash-completion: suggest bus properties instead of configuration items for 'systemctl -p'
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 May 2018 05:19:16 +0000 (14:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 May 2018 09:13:52 +0000 (18:13 +0900)
Closes #5137.

shell-completion/bash/systemctl.in

index 30056e37821381f870f62c87a3eccbc120660347..4a0ceb879a2df2363dafdb7789c979438603309a 100644 (file)
@@ -11,12 +11,7 @@ __systemctl() {
 }
 
 __systemd_properties() {
-        local mode=$1
-        { __systemctl $mode show --all;
-         @rootlibexecdir@/systemd --dump-configuration-items; } |
-        while IFS='=' read -r key value; do
-            [[ $value ]] && echo "$key"
-        done
+        @rootlibexecdir@/systemd --dump-bus-properties
 }
 
 __contains_word () {
@@ -154,7 +149,7 @@ _systemctl () {
                                 comps=$(compgen -A hostname)
                         ;;
                         --property|-p)
-                                comps=$(__systemd_properties $mode)
+                                comps=$(__systemd_properties)
                         ;;
                         --preset-mode)
                                 comps='full enable-only disable-only'