Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[Patch] fix-zypper-commands-completion
- X-seq: zsh-workers 32487
- From: Mariusz Fik <fisiu@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [Patch] fix-zypper-commands-completion
- Date: Sat, 15 Mar 2014 20:43:12 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=g51GK8hZJohQX2d3BvupBiTA7T8rPuAz4p/GbNOGUgc=; b=wTsc0YGqlEYArfR06eXQOYrOfCihwlJ3R3FqWlDbs6i38iXDOmoKEYSI7F7/tViepG c2dRNq6vJQLgRZ+r1sLudZC6vm763VaRQvaiZ6mqM9/y0o28490XBp4TePn207Ho0uVo UqRPHcRH1theCTKguA1+PkDTuJ7tcfluGhqZmFV+8cf5ku/7ovO8WAgmxXtPM/VbQkb1 XmdRXZ6OGjFGAvbZMtUtEA4LJQQkFLgd45mLClTA2qjapshNjEjRRzBDJq2o2lxcEV00 l5WdjnRjBwaVCxSb8f3bCjgLKmrcDOVNKbcCANAXCqRx53tBxjcQMdawnrTEHZC4/RIv rwfg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Sender: fisiu82@xxxxxxxxx
Hi,
current version of _zypper file completion completes only global options. This patch fixes it, and now after typing `zypper <TAB>`, besides global options, all commands are on the list.
--
Pozdrawiam / Best regards,
Mariusz Fik,
openSUSE Community Member
From 08c2443e5722b578943d2eccfca708e54dea5d20 Mon Sep 17 00:00:00 2001
From: Mariusz Fik <fisiu@xxxxxxxxxxxx>
Date: Sat, 15 Mar 2014 20:23:51 +0100
Subject: [PATCH] Fix zypper commands completion [zypper <TAB>].
Signed-off-by: Mariusz Fik <fisiu@xxxxxxxxxxxx>
---
Completion/openSUSE/Command/_zypper | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Completion/openSUSE/Command/_zypper b/Completion/openSUSE/Command/_zypper
index ef8ca20..25a32c3 100644
--- a/Completion/openSUSE/Command/_zypper
+++ b/Completion/openSUSE/Command/_zypper
@@ -2,6 +2,7 @@
#
# Copyright (C) 2009 Holger Macht <holger@xxxxxxxx>
# Copyright (C) 2014 Thomas Mitterfellner <thomas.mitterfellner@xxxxxxxxx>
+# Copyright (C) 2014 Mariusz Fik <fisiu@xxxxxxxxxxxx>
#
# 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
--
1.8.4.5
Messages sorted by:
Reverse Date,
Date,
Thread,
Author