Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: completion function for apachectl
- X-seq: zsh-workers 13539
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: Re: completion function for apachectl
- Date: Mon, 26 Feb 2001 16:07:19 +0000
- In-reply-to: <000a01c0a007$412ce390$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <000a01c0a007$412ce390$21c9ca95@xxxxxxxxxxxxxx>
On Feb 26, 6:17pm, Andrej Borsenkow wrote:
}
} > +_sub_commands start stop
}
} Well, Linux strikes again. You can be sure only in the above; restart and
} status are not universally supported.
One could probably pull a stunt like this:
_sub_commands $(sed -ne '/case/,/esac/{;s/^ *\([a-z|)]*\).*/\1/g;s/[|)]/ /gp;}' $words[1])
Runs a slight risk of finding case-labels that aren't actually part of the
argument parsing -- on a RedHat 6.2 machine it finds y, n, and c in one of
the scripts -- but for the most part it's pretty accurate.
Tuning the regex and adapting to older seds left as an exercise.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author