From: Dave Reisner Date: Sat, 30 Aug 2014 00:35:15 +0000 (-0400) Subject: completion: filter templates from restartable units X-Git-Tag: v217~704 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=ec15977a3cd82eff6c94bb13db72195f7cd512e8;ds=sidebyside completion: filter templates from restartable units Since c6a373a2634854, we might encounter unit templates via the 'list-units' verb. These aren't restartable (and we throw errors), so make sure they're filtered out of the completion options. fixes downstream bug: https://bugs.archlinux.org/task/41719 --- diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index 64b15df46..015001815 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -182,7 +182,7 @@ _systemctl () { comps=$( __filter_units_by_property $mode CanStart yes \ $( __get_all_units $mode \ | while read -r line; do \ - [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo " $line"; \ + [[ "$line" =~ @\.|\.(device|snapshot|socket|timer)$ ]] || echo " $line"; \ done )) compopt -o filenames