Zbigniew Jędrzejewski-Szmek 62fe94
From ec15977a3cd82eff6c94bb13db72195f7cd512e8 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 62fe94
From: Dave Reisner <dreisner@archlinux.org>
Zbigniew Jędrzejewski-Szmek 62fe94
Date: Fri, 29 Aug 2014 20:35:15 -0400
Zbigniew Jędrzejewski-Szmek 62fe94
Subject: [PATCH] completion: filter templates from restartable units
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
Since c6a373a2634854, we might encounter unit templates via the
Zbigniew Jędrzejewski-Szmek 62fe94
'list-units' verb. These aren't restartable (and we throw errors), so
Zbigniew Jędrzejewski-Szmek 62fe94
make sure they're filtered out of the completion options.
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
fixes downstream bug: https://bugs.archlinux.org/task/41719
Zbigniew Jędrzejewski-Szmek 62fe94
---
Zbigniew Jędrzejewski-Szmek 62fe94
 shell-completion/bash/systemctl.in | 2 +-
Zbigniew Jędrzejewski-Szmek 62fe94
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
Zbigniew Jędrzejewski-Szmek 62fe94
index 64b15df462..015001815f 100644
Zbigniew Jędrzejewski-Szmek 62fe94
--- a/shell-completion/bash/systemctl.in
Zbigniew Jędrzejewski-Szmek 62fe94
+++ b/shell-completion/bash/systemctl.in
Zbigniew Jędrzejewski-Szmek 62fe94
@@ -182,7 +182,7 @@ _systemctl () {
Zbigniew Jędrzejewski-Szmek 62fe94
                 comps=$( __filter_units_by_property $mode CanStart yes \
Zbigniew Jędrzejewski-Szmek 62fe94
                       $( __get_all_units $mode \
Zbigniew Jędrzejewski-Szmek 62fe94
                         | while read -r line; do \
Zbigniew Jędrzejewski-Szmek 62fe94
-                                [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
Zbigniew Jędrzejewski-Szmek 62fe94
+                                [[ "$line" =~ @\.|\.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
Zbigniew Jędrzejewski-Szmek 62fe94
                         done ))
Zbigniew Jędrzejewski-Szmek 62fe94
                 compopt -o filenames
Zbigniew Jędrzejewski-Szmek 62fe94