Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] _net_interfaces: enable completion for mappings on debian systems



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.

The first part of the patch avoids use of sed, when filling ${intf}.

The second part contains the patch to enable completion for mappings and
corrections of ifdown.

1. ifdown: If we call completion for ifdown look in
           /etc/network/run/ifstate and list the registered interfaces

2. ifup: My patch tries to dedect, if you use mappings. If you do use
         them, then my _net_interfaces completion lists all cominations
	 of interfaces and mappings, excluding the loopback interface.
	 In any other case it acts in the same way as the actual
	 completion.

   eg. - ifconfig -a lists eth0 and lo. Both of them are in
         /etc/network/interfaces -> Behavior as known
       - ifconfig -a lists eth0 and lo, but only one or none of them is
	 listed in /etc/network/interfaces and no other mapping is used
	 -> Behavior as known
       - ifconfig -a lists eth0 and lo. /etc/network/interfaces contains
	 one, none or both of them, but also other mappings ->
	 Completion lists all possible compinations of interfaces and
	 mappings excluding the loopback interface.

I tested this patch with zsh 4.3.4-dev-7 on debian unstable. 

Excuse me for only posting a link but i use gmane and slrn to poste this 
patch and it seems that slrn is not capable of attaching files.

http://members.inode.at/sepp.steiner/test/_net_interfaces.patch

Regards,
Sepp



Messages sorted by: Reverse Date, Date, Thread, Author