Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _net_interfaces: enable completion for mappings on debian systems
- X-seq: zsh-workers 24433
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Sepp Steiner <steiner.sepp@xxxxxxx>
- Subject: Re: [PATCH] _net_interfaces: enable completion for mappings on debian systems
- Date: Tue, 22 Jan 2008 10:53:49 +0100
- Cc: zsh-workers@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Received:cc:In-reply-to:From:References:To:Subject:Date:Message-ID; b=1apUxJKYWZvpzvxoLkfHknwY1+7bwHNh4ouvCVbIvG1Hcy8/Jb66yLdjSqwcRg6P95Vxx0g7HTKPgme16dhXT2fPPCCSPQlvLvs4u9QC2fVePQ9I/i2bre6UduzQ2Fkt2iPoRPc7ZmMa10kqXBzkDKKeP1e6htQiUyy7i/OJV1E= ;
- In-reply-to: <fn3bjk$4o6$1@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <fn3bjk$4o6$1@xxxxxxxxxxxxx>
Sepp Steiner wrote:
> The main part of this patch enables completion of mappings for ifup on
> debian systems and for ifdown the completion lists only interfaces that
> are really up and running.
This looks useful. Limiting matches is always good. However, it doesn't
seem right to me that _net_interfaces, which completes network interfaces
in general, should have specific knowledge of ifup and ifdown - Debian
specific commands.
What would be good would be if _net_interfaces took an option to limit
that state of the interfaces it completes. You'd need to find a suitable
option letter that doesn't clash with a completion option (so -s for
state is out because it is used for suffixes). ifup and ifdown would
need their own completion function but it'd be as simple as something
like the following:
case $service in
(ifup) _net_interfaces -n down;;
(ifdown) _net_interfaces -n up;;
esac
This would also have the advantage that completion of network interfaces
elsewhere could then be limited to interfaces that are up or down.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author