[csw-devel] SF.net SVN: gar:[14990] csw/mgar/pkg/zsh/trunk

opk at users.sourceforge.net opk at users.sourceforge.net
Wed Jul 6 13:49:38 CEST 2011


Revision: 14990
          http://gar.svn.sourceforge.net/gar/?rev=14990&view=rev
Author:   opk
Date:     2011-07-06 11:49:38 +0000 (Wed, 06 Jul 2011)

Log Message:
-----------
zsh/trunk: add mgar shell completion function

Modified Paths:
--------------
    csw/mgar/pkg/zsh/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/zsh/trunk/files/_mgar

Modified: csw/mgar/pkg/zsh/trunk/Makefile
===================================================================
--- csw/mgar/pkg/zsh/trunk/Makefile	2011-07-06 01:04:18 UTC (rev 14989)
+++ csw/mgar/pkg/zsh/trunk/Makefile	2011-07-06 11:49:38 UTC (rev 14990)
@@ -11,7 +11,7 @@
 
 MASTER_SITES = $(SF_MIRRORS)
 DISTFILES  = $(NAME)-$(VERSION).tar.bz2
-DISTFILES += _pkgutil
+DISTFILES += _pkgutil _mgar
 DISTFILES += CSWzsh.postinstall CSWzsh.postremove
 
 PACKAGES = CSWzsh
@@ -67,4 +67,4 @@
 CPPFLAGS := -I$(includedir)/ncursesw $(CPPFLAGS)
 
 post-install:
-	cp -p $(WORKDIR)/_pkgutil $(DESTDIR)$(sharedstatedir)/$(NAME)/functions
+	cp -p $(WORKDIR)/_pkgutil $(WORKDIR)/_mgar $(DESTDIR)$(sharedstatedir)/$(NAME)/functions

Added: csw/mgar/pkg/zsh/trunk/files/_mgar
===================================================================
--- csw/mgar/pkg/zsh/trunk/files/_mgar	                        (rev 0)
+++ csw/mgar/pkg/zsh/trunk/files/_mgar	2011-07-06 11:49:38 UTC (rev 14990)
@@ -0,0 +1,39 @@
+#compdef mgar
+
+local curcontext="$curcontext" ret=1
+local subcmd
+local -a cmds
+
+if (( CURRENT == 2 )); then
+  cmds=(
+    help:list\ available\ commands
+    ${${(M)${(f)"$(_call_program commands ${words[1]} help)"}:#  *}//  (#b)([a-z-]##)[^A-Z]##(?)/$match[1]:${match[2]:l}}
+  )
+
+  _describe 'mgar command' cmds && ret=0
+else
+  shift words
+  (( CURRENT-- ))
+  subcmd="$words[1]"
+  curcontext="${curcontext%:*}-${subcmd}:"
+  case $subcmd in
+  commit)
+    _arguments '-m:commit message' && ret=0
+  ;;
+  scm)
+    service=svn
+    _subversion && ret=0
+  ;;
+  init)
+    _directories && ret=0
+  ;;
+  up)
+    _arguments '--all' && ret=0
+  ;;
+  *)
+    _default && ret=0
+  ;;
+  esac
+fi
+
+return ret


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list