SF.net SVN: gar:[22918] csw/mgar/pkg/zsh/trunk

opk at users.sourceforge.net opk at users.sourceforge.net
Thu Jan 30 14:48:47 CET 2014


Revision: 22918
          http://sourceforge.net/p/gar/code/22918
Author:   opk
Date:     2014-01-30 13:48:45 +0000 (Thu, 30 Jan 2014)
Log Message:
-----------
zsh: add completion function for opencsw alternatives

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

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

Modified: csw/mgar/pkg/zsh/trunk/Makefile
===================================================================
--- csw/mgar/pkg/zsh/trunk/Makefile	2014-01-30 13:20:12 UTC (rev 22917)
+++ csw/mgar/pkg/zsh/trunk/Makefile	2014-01-30 13:48:45 UTC (rev 22918)
@@ -11,7 +11,7 @@
 
 MASTER_SITES = $(SF_MIRRORS)
 DISTFILES  = $(NAME)-$(VERSION).tar.bz2
-DISTFILES += _pkgutil _mgar
+DISTFILES += _pkgutil _mgar _alternatives
 
 PACKAGES = CSWzsh
 CATALOGNAME_CSWzsh = zsh
@@ -41,5 +41,5 @@
 CPPFLAGS := -I$(includedir)/ncursesw $(CPPFLAGS)
 
 post-install-modulated:
-	cp -p $(WORKDIR)/_pkgutil $(WORKDIR)/_mgar $(DESTDIR)$(sharedstatedir)/$(NAME)/functions
+	cp -p $(WORKDIR)/_pkgutil $(WORKDIR)/_mgar $(WORKDIR)/_alternatives $(DESTDIR)$(sharedstatedir)/$(NAME)/functions
 	@$(MAKECOOKIE)

Added: csw/mgar/pkg/zsh/trunk/files/_alternatives
===================================================================
--- csw/mgar/pkg/zsh/trunk/files/_alternatives	                        (rev 0)
+++ csw/mgar/pkg/zsh/trunk/files/_alternatives	2014-01-30 13:48:45 UTC (rev 22918)
@@ -0,0 +1,13 @@
+#compdef alternatives
+
+local -a args
+args=(
+  '(- 2)'{--display,--auto,--config} '(-)'{--set,--remove}
+  '(1 2 -)--install:path:_files:name: :priority'
+  '(1 2 -)'{--relink-missing,--list}
+  '2:path:_files'
+)
+(( CURRENT > 2 )) &&
+  args+='1:name:( ${${(f)"$(/opt/csw/sbin/alternatives --list)"}[2,-1]} )'
+
+_arguments $args

Modified: csw/mgar/pkg/zsh/trunk/files/_mgar
===================================================================
--- csw/mgar/pkg/zsh/trunk/files/_mgar	2014-01-30 13:20:12 UTC (rev 22917)
+++ csw/mgar/pkg/zsh/trunk/files/_mgar	2014-01-30 13:48:45 UTC (rev 22918)
@@ -7,6 +7,9 @@
 if (( CURRENT == 2 )); then
   cmds=(
     help:list\ available\ commands
+    install:install\ files\ to\ staging\ directory
+    makepatch:create\ a\ patch\ for\ outstanding\ changes
+    check-prereqs checksum test
     ${${(M)${(f)"$(_call_program commands ${words[1]} help)"}:#  *}//  (#b)([a-z-]##)[^A-Z]##(?)/$match[1]:${match[2]:l}}
   )
 

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