zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _quilt: fix push and pop completion
@ 2011-07-26 22:57 Luka Perkov
  2011-07-27  7:50 ` Frank Terbeck
  0 siblings, 1 reply; 5+ messages in thread
From: Luka Perkov @ 2011-07-26 22:57 UTC (permalink / raw)
  To: zsh-workers

Patch fixes 'bug' in _quilt completion script when there is not possible
to do push or pop. Also tabs are replaced with spaces because they were
not consistent.

Signed-off-by: Luka Perkov < lists ->-to->- lukaperkov.net >
---

diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt
index a2fd799..d12a672 100644
--- a/Completion/Unix/Command/_quilt
+++ b/Completion/Unix/Command/_quilt
@@ -14,17 +14,23 @@ case "$state" in
 
   case "$words[1]" in
       (applied|delete|files|graph|header|next|previous|refresh|unapplied)
-      	_wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"}
-	;;
+        _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"}
+        ;;
       (push)
-    	_wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"}
-    	;;
+        tmp=$(quilt unapplied 2>&1)
+        if [[ "$tmp[1,40]" != "File series fully applied, ends at patch" ]]; then
+          _wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"}
+        fi
+        ;;
       (pop)
-    	_wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"}
-    	;;
+        tmp=$(quilt applied 2>&1)
+        if [[ "$tmp" != "No patches applied" ]]; then
+          _wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"}
+        fi
+        ;;
       (*)
-    	_files
-    	;;
+        _files
+        ;;
   esac
   ;;
 esac


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-29 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26 22:57 PATCH: _quilt: fix push and pop completion Luka Perkov
2011-07-27  7:50 ` Frank Terbeck
2011-07-27 18:21   ` Luka Perkov
2011-07-29 13:10     ` Frank Terbeck
2011-07-29 22:15       ` Luka Perkov

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).