about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMariusz Fik <fisiu@opensuse.org>2014-03-15 20:23:51 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-03-16 18:28:52 +0000
commit8c9df2ca1d552e2e1f4a8d23c97909ca8ad0f10d (patch)
tree9fb4d63a0c41f1df04617b36406b5fb07eb00ed1
parent6ebb9f6a31f362ecd55c79e647fe09c0b0712039 (diff)
downloadzsh-8c9df2ca1d552e2e1f4a8d23c97909ca8ad0f10d.tar.gz
zsh-8c9df2ca1d552e2e1f4a8d23c97909ca8ad0f10d.tar.xz
zsh-8c9df2ca1d552e2e1f4a8d23c97909ca8ad0f10d.zip
Fix zypper commands completion [zypper <TAB>].
Signed-off-by: Mariusz Fik <fisiu@opensuse.org>
-rw-r--r--Completion/openSUSE/Command/_zypper5
1 files changed, 4 insertions, 1 deletions
diff --git a/Completion/openSUSE/Command/_zypper b/Completion/openSUSE/Command/_zypper
index ef8ca203c..25a32c3f1 100644
--- a/Completion/openSUSE/Command/_zypper
+++ b/Completion/openSUSE/Command/_zypper
@@ -2,6 +2,7 @@
 #
 # Copyright (C) 2009 Holger Macht <holger@homac.de>
 # Copyright (C) 2014 Thomas Mitterfellner <thomas.mitterfellner@gmail.com>
+# Copyright (C) 2014 Mariusz Fik <fisiu@opensuse.org>
 #
 # This file is released under the GPLv2.
 #
@@ -45,8 +46,10 @@ _zypper() {
             # start parsing with "Global Options:"
             [[ $hline =~ "^Global Options:" ]] && tag=1
             [[ $tag = 0 ]] && continue
+            # skip empty lines
+            [[ $hline =~ ^\s*$ ]] && continue
             # all commands have to start with lower case letters
-            [[ $hline[1] =~ ^[A-Z] ]] && continue
+            [[ $hline == [[:upper:]]* ]] && continue
             (( ${#hline} < 2 )) && continue
 
             # cut comma at end of command