roothausen

  • Impressum
  • Administration
  • Kontaktformular
  • Jabber
  • Tagcloud
  • Twitter
  • Soup
  • Github

Entries from Wednesday, January 23. 2008

ZSH-Vervollstaendigung fuer Pacman und netcfg2

21:25

Wednesday, January 23. 2008

Seit heute ist im offiziellen Paket von pacman fuer Arch Linux auch eine Autovervollstaendigung fuer die ZSH dabei:

pacman -Ql pacman|grep zsh              
pacman /usr/share/zsh/
pacman /usr/share/zsh/site-functions/
pacman /usr/share/zsh/site-functions/_pacman

Ich hatte das zwar schon vorher, musste aber nach einem Upgrade die Dateien von Hand patchen, da sich Pfade geaendert hatten. Nun ist es super das bei pacman dabei zu haben. :-)

Zudem habe ich mir vor ein paar Wochen auf Basis des Codes aus AUR eine Vervollstaendigung fuer netcfg2 gebastelt:

#compdef netcfg2
local expl list intf sep
local -a disp

case $OSTYPE in
   aix*)
   intf=( ${(f)"$(lsdev -C -c if -F 'name:description')"} )
   if zstyle -T ":completion:${curcontext}" verbose; then
      zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-
      zformat -a list " $sep " "$intf[@]"
      disp=(-ld list)
   fi
   ;;
   darwin*|freebsd*|dragonfly*) intf=( $(ifconfig -l) ) ;;
   irix*) intf=( ${${${(f)"$(/usr/etc/netstat -i)"}%% *}[2,-1]} ) ;;
   linux*) intf=( /proc/sys/net/ipv4/conf/*~*(all|default)(N:t) ) ;;
   *) intf=( $(ifconfig -a|sed -n 's/^\([^       :]*\).*/\1/p') ) ;;
esac

_arguments -C \
'*:profile:->profilelist' \
'-d[Take specified profile down]:profile:->profilelist' \
'-a[Take all profiles down]' \
'-c[Do not start profile if interface is already up]:profile:->profilelist' \
'-i[Take down profile active on specified interface]:interface:->interfaces'

if [[ "$state" = profilelist ]]; then
   _description path_files expl 'Netwok Profiles'
   _path_files "$expl[@]" -W '/etc/network.d' -g '*~*template'
fi

if [[ "$state" = interfaces ]]; then
   _wanted interfaces expl 'network interface' compadd "$@" "$disp[@]" - "${(@)intf%%:*}"
fi
 

Das Ganze sollte in der Datei /usr/share/zsh/site-functions/_netcfg2 abgelegt werden.

Posted by admin in computer | Comment (1) | Trackbacks (0)
Defined tags for this entry: computer, linux&unix, opensource, shortys, software

Die Zukunft in Deutschland

09:21

Wednesday, January 23. 2008

zukunft_500.png
[via strcat]

Posted by admin in misc, web, zeitgeist | Comments (7) | Trackbacks (0)
Defined tags for this entry: bad world, fun, privacy, webwide
(Page 1 of 1, totaling 2 entries)

JavaScript String .fromCharCode

Calendar

« January '08 »
Mo Tu We Th Fr Sa Su
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Quicksearch

Kategorien

  • XML computer
  • XML misc
  • XML web
  • XML zeitgeist


All categories

Archiv

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • Recent...
  • Older...

Feeds

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments

Links

Retinacast
Shackspace
Yaxim
Radio Tux
Kais Blog
Blumen Pfleiderer
Alk
paxos
filzo
Marc Seeger
polzifer
Moritz Haarmann

Tags

android bad world blog blogging browser changes code comic computer contentmanagement encryption feedreader firefox free fun google gui hardware howto html im jabber java life lighttpd linux linux&unix markup media misc mobile murphy networking newsbeuter opensource picture politics presentation privacy programming regular expression rss ruby s9y scala screenshot sdk security server shortys software stuff tail -f /var/log/life test tool tv unix video web webdesign webwide windows xml zeitgeist

Lizenz

Creative Commons License - Some Rights Reserved