Author: glen                         Date: Fri Sep 29 10:47:53 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initial, works

---- Files affected:
SOURCES:
   webapp-bash_completion.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/webapp-bash_completion.sh
diff -u /dev/null SOURCES/webapp-bash_completion.sh:1.1
--- /dev/null   Fri Sep 29 12:47:53 2006
+++ SOURCES/webapp-bash_completion.sh   Fri Sep 29 12:47:48 2006
@@ -0,0 +1,40 @@
+have webapp && {
+
+# webapp(1) completion
+#
+_webapp()
+{
+       local cur prev
+
+       COMPREPLY=()
+       cur=${COMP_WORDS[COMP_CWORD]}
+       prev=${COMP_WORDS[COMP_CWORD-1]}
+
+       case "$COMP_CWORD" in
+       1)
+               COMPREPLY=($( compgen -W 'register unregister list list-apps' 
-- $cur ))
+               ;;
+       2)
+               case "$prev" in
+               register|unregister|list)
+                       COMPREPLY=($( compgen -W 'apache httpd lighttpd' -- 
$cur ))
+                       ;;
+               esac
+               ;;
+       3)
+               case "${COMP_WORDS[COMP_CWORD-2]}" in
+               register)
+                       COMPREPLY=($( compgen -W "$(webapp 
list-apps-unregistered $prev)" -- $cur ))
+                       ;;
+               unregister)
+                       COMPREPLY=($( compgen -W "$(webapp list-apps-registered 
$prev)" -- $cur ))
+                       ;;
+               esac
+               ;;
+       esac
+
+#      return 0
+}
+
+complete -F _webapp webapp
+}
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to