]> git.pld-linux.org Git - packages/webapps.git/commitdiff
- initial, works
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 29 Sep 2006 10:47:48 +0000 (10:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    webapp-bash_completion.sh -> 1.1

webapp-bash_completion.sh [new file with mode: 0644]

diff --git a/webapp-bash_completion.sh b/webapp-bash_completion.sh
new file mode 100644 (file)
index 0000000..0ef94c3
--- /dev/null
@@ -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
+}
This page took 0.05322 seconds and 4 git commands to generate.