zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _a2utils
       [not found] <20061011102909.25864.69053.reportbug@kaoru.asyd.net>
@ 2006-10-14 18:08 ` Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2006-10-14 18:08 UTC (permalink / raw)
  To: zsh-workers, Emmanuel Bouthenot, 392338-forwarded

> I've made a new completion for debian specific apache utils :
> 
>  + _a2utils gives completion for a2ensite, a2dissite, a2enmod, a2dismod commands.

> #compdef a2ensite a2dissite a2enmod a2dismod
> 
> case "$service" in
>     a2ensite)
> 	sites=( /etc/apache2/sites-available/*(:t) )
> 	_wanted sites expl sites compadd $sites
> 	;;
>     a2dissite)
> 	sites=( /etc/apache2/sites-enabled/*(:t) )
> 	_wanted sites expl sites compadd $sites
> 	;;
>     a2enmod)
> 	mods=( /etc/apache2/mods-available/*.load(:r:t) )
> 	_wanted mods expl mods compadd $mods
> 	;;
>     a2dismod)
> 	mods=( /etc/apache2/mods-enabled/*.load(:r:t) )
> 	_wanted mods expl mods compadd $mods
> 	;;
> esac
> 
> return 0

Tweaking a bit..

Index: Completion/Debian/Command/_a2utils
===================================================================
RCS file: Completion/Debian/Command/_a2utils
diff -N Completion/Debian/Command/_a2utils
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Debian/Command/_a2utils	14 Oct 2006 18:05:37 -0000
@@ -0,0 +1,24 @@
+#compdef a2ensite a2dissite a2enmod a2dismod
+
+local -a mods
+
+case "$service" in
+    a2ensite)
+	_wanted sites expl sites \
+	  _files -W /etc/apache2/sites-available
+	;;
+    a2dissite)
+	_wanted sites expl sites \
+	  _files -W /etc/apache2/sites-enabled
+	;;
+    a2enmod)
+	mods=( /etc/apache2/mods-available/*.load(N:r:t) )
+	_wanted mods expl mods compadd -a mods
+	;;
+    a2dismod)
+	mods=( /etc/apache2/mods-enabled/*.load(N:r:t) )
+	_wanted mods expl mods compadd -a mods
+	;;
+esac
+
+return 0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-14 18:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20061011102909.25864.69053.reportbug@kaoru.asyd.net>
2006-10-14 18:08 ` PATCH: _a2utils Clint Adams

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).