Permalink
Browse files

add some generic GNU --help completions for a few commands

  • Loading branch information...
1 parent fce1aa0 commit e2321b952b0b72c909964ca44fe4faf0a6799773 @rsanders committed Feb 11, 2012
Showing with 44 additions and 0 deletions.
  1. +44 −0 zsh/plugins/gnucompletions/zshrc.zsh
View
44 zsh/plugins/gnucompletions/zshrc.zsh
@@ -0,0 +1,44 @@
+#
+
+function() {
+ typeset -a gnucmds
+ typeset -a -g GNU_GENERIC_COMMANDS
+
+ if [[ $dotto_vars[os] -eq "Darwin" ]]; then
+ # Spotlight
+ gnucmds+=( mdfind mdls mdutil mdimport mddiagnose )
+ gnucmds+=( pkgutil dtrace otool )
+
+ # various system dtrace scripts
+ gnucmds+=( /usr/bin/*.d(.x) )
+ elif [[ $dotto_vars[os] -eq "Linux" ]]; then
+ gnucmds+=( ls cat )
+ fi
+
+ # archives
+ gnucmds+=( gzip gzcat gzede gunzip tar gnutar zcat znew )
+
+ # build tools
+ gnucmds+=( autoconf aclocal autoheader automake autom4te autoreconf m4 gm4 )
+ gnucmds+=( gcc ld cc cpp bison yacc lex flex make gnumake )
+
+ # interpreters and shells
+ gnucmds+=( bash ksh awk gawk gsed gcov etags ctags )
+
+ # fileutils
+ gnucmds+=( cmp diff diff3 patch grep egrep fgrep sort )
+
+ # editors
+ gnucmds+=( nano )
+
+ # file mangling
+ gnucmds+=( sha1sum shasum )
+
+ # misc doc stuff
+ gnucmds+=( groff iconv info install-info makeinfo texi2html )
+
+ local cmd
+ for cmd in $gnucmds; do
+ compdef _gnu_generic $cmd
+ done
+}

0 comments on commit e2321b9

Please sign in to comment.