[systemd-commits] shell-completion/bash
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Sat Jul 26 17:16:15 PDT 2014
shell-completion/bash/systemctl.in | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit c6a373a26348544d944b08bf0c5dea4f72f6980b
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Jul 26 20:11:58 2014 -0400
bash-completion: use list-unit-files to get "all" units
I think that it is better to return good results slightly more slowly,
than partial quickly. Also reading from disk seems fast enough. Even
the delay on first try with completely cold cache is acceptable.
This is just for bash, 'cause zsh was already doing this.
https://bugzilla.redhat.com/show_bug.cgi?id=790768
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index c5950cc..69ef04b 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -51,11 +51,13 @@ __filter_units_by_property () {
done
}
-__get_all_units () { __systemctl $1 list-units --all \
+__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
| { while read -r a b; do echo " $a"; done; }; }
__get_active_units () { __systemctl $1 list-units \
| { while read -r a b; do echo " $a"; done; }; }
-__get_startable_units () { __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap \
+__get_startable_units () { {
+ __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap
+ __systemctl $1 list-unit-files -t service,timer,socket,mount,automount,path,snapshot,swap; } \
| { while read -r a b c d; do [[ $c == "inactive" || $c == "failed" ]] && echo " $a"; done; }; }
__get_failed_units () { __systemctl $1 list-units \
| { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; }
More information about the systemd-commits
mailing list