From e7c3bbe23c57426698698c2dd20d7d630cfb3951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 8 Jun 2009 21:22:43 +0300 Subject: [PATCH] Add missing 'have foo's. --- contrib/bitkeeper | 3 ++- contrib/bittorrent | 4 +++- contrib/cksfv | 3 ++- contrib/clisp | 3 ++- contrib/dsniff | 33 ++++++++++++++++++++++----------- contrib/findutils | 3 ++- contrib/freeciv | 6 ++++-- contrib/gcl | 5 +++-- contrib/gkrellm | 3 ++- contrib/gnatmake | 5 +++-- contrib/isql | 3 ++- contrib/larch | 5 +++-- contrib/lisp | 5 +++-- contrib/mcrypt | 5 +++-- contrib/mtx | 3 ++- contrib/p4 | 3 ++- contrib/povray | 3 ++- contrib/ri | 2 ++ contrib/sbcl | 3 ++- contrib/sitecopy | 3 ++- contrib/snownews | 3 ++- contrib/svk | 3 ++- contrib/tar | 2 ++ contrib/unace | 3 ++- contrib/unrar | 3 ++- contrib/vncviewer | 5 +++-- contrib/wodim | 2 +- 27 files changed, 82 insertions(+), 42 deletions(-) diff --git a/contrib/bitkeeper b/contrib/bitkeeper index 8e1cc3cd..154a7ae5 100644 --- a/contrib/bitkeeper +++ b/contrib/bitkeeper @@ -3,6 +3,7 @@ # # BitKeeper completion adapted from code by Bart Trojanowski +have bk && _bk() { local BKCMDS @@ -16,5 +17,5 @@ _bk() { _filedir return 0 -} +} && complete -F _bk bk diff --git a/contrib/bittorrent b/contrib/bittorrent index a240d47c..9e49ac72 100644 --- a/contrib/bittorrent +++ b/contrib/bittorrent @@ -3,6 +3,8 @@ # # btdownloadheadless(1) completion by Guillaume Rousse +have btdownloadheadless.py || have btdownloadcurses.py || \ +have btdownloadgui.py && _btdownload() { local cur prev @@ -34,5 +36,5 @@ _btdownload() else _filedir fi -} +} && complete -F _btdownload btdownloadheadless.py btdownloadcurses.py btdownloadgui.py diff --git a/contrib/cksfv b/contrib/cksfv index f759e9ee..cbb8c0aa 100644 --- a/contrib/cksfv +++ b/contrib/cksfv @@ -3,6 +3,7 @@ # # cksfv completion by Chris +have cksfv && _cksfv() { COMPREPLY=() @@ -26,5 +27,5 @@ _cksfv() _filedir return 0 -} +} && complete -F _cksfv cksfv diff --git a/contrib/clisp b/contrib/clisp index 6c6d9b63..bc4e376b 100644 --- a/contrib/clisp +++ b/contrib/clisp @@ -4,6 +4,7 @@ # bash brogrammable completion for various Common Lisp implementations by # Nikodemus Siivola +have clisp && _clisp() { local cur @@ -22,5 +23,5 @@ _clisp() fi return 0 -} +} && complete -F _clisp $default clisp diff --git a/contrib/dsniff b/contrib/dsniff index c426da46..93243c44 100644 --- a/contrib/dsniff +++ b/contrib/dsniff @@ -5,6 +5,7 @@ # arpspoof(8) completion # +have arpspoof && _arpspoof() { local cur prev @@ -30,11 +31,12 @@ _arpspoof() _known_hosts fi -} +} && complete -F _arpspoof arpspoof # dnsspoof(8) completion # +have dnsspoof && _dnsspoof() { local cur prev @@ -58,11 +60,12 @@ _dnsspoof() COMPREPLY=( $( compgen -W '-i -f' -- $cur ) ) fi -} +} && complete -F _dnsspoof dnsspoof # dsniff(8) completion # +have dsniff && _dsniff() { local cur prev @@ -87,11 +90,12 @@ _dsniff() -r -w' -- $cur ) ) fi -} +} && complete -F _dsniff dsniff # filesnarf(8), mailsnarf(8) and msgsnarf (8) completion # +have filesnarf || have mailsnarf || have msgsnarf && _snarf() { local cur prev @@ -111,11 +115,12 @@ _snarf() COMPREPLY=( $( compgen -W '-i -v' -- $cur ) ) fi -} +} && complete -F _snarf filesnarf mailsnarf msgsnarf # macof(8) completion # +have macof && _macof() { local cur prev @@ -136,11 +141,12 @@ _macof() COMPREPLY=( $( compgen -W '-i -s -d -e -x -y -n' -- $cur ) ) fi -} +} && complete -F _macof macof # sshmitm(8) completion # +have sshmitm && _sshmitm() { local cur @@ -154,11 +160,12 @@ _sshmitm() _known_hosts fi -} +} && complete -F _sshmitm sshmitm # sshow(8) completion # +have sshow && _sshow() { local cur prev @@ -178,11 +185,12 @@ _sshow() COMPREPLY=( $( compgen -W '-d -i' -- $cur ) ) fi -} +} && complete -F _sshow sshow # tcpkill(8) completion # +have tcpkill && _tcpkill() { local cur prev @@ -202,11 +210,12 @@ _tcpkill() COMPREPLY=( $( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- $cur ) ) fi -} +} && complete -F _tcpkill tcpkill # tcpnice(8) completion # +have tcpnice && _tcpnice() { local cur prev @@ -226,11 +235,12 @@ _tcpnice() COMPREPLY=( $( compgen -W '-A -I -M -i' -- $cur ) ) fi -} +} && complete -F _tcpnice tcpnice # urlsnarf(8) completion # +have urlsnarf && _urlsnarf() { local cur prev @@ -250,11 +260,12 @@ _urlsnarf() COMPREPLY=( $( compgen -W '-n -i -v' -- $cur ) ) fi -} +} && complete -F _urlsnarf urlsnarf # webmitm(8) completion # +have webmitm && _webmitm() { local cur @@ -268,5 +279,5 @@ _webmitm() _known_hosts fi -} +} && complete -F _webmitm webmitm diff --git a/contrib/findutils b/contrib/findutils index 819e61a1..6cc38873 100644 --- a/contrib/findutils +++ b/contrib/findutils @@ -5,6 +5,7 @@ # globs and contains Linux specific code for completing the parameter # to the -fstype option. +have find && _find() { local cur prev i exprfound onlyonce @@ -111,5 +112,5 @@ _find() _filedir return 0 -} +} && complete -F _find $filenames find diff --git a/contrib/freeciv b/contrib/freeciv index b27c9fb5..f01a08de 100644 --- a/contrib/freeciv +++ b/contrib/freeciv @@ -3,6 +3,7 @@ # # civserver completion by Guillaume Rousse +have civserver && _civserver() { local cur prev @@ -25,11 +26,12 @@ _civserver() -- $cur ) ) fi -} +} && complete -F _civserver civserver # civclient completion by Guillaume Rousse # +have civclient && _civclient() { local cur prev @@ -60,5 +62,5 @@ _civclient() -- $cur ) ) fi -} +} && complete -F _civclient civclient diff --git a/contrib/gcl b/contrib/gcl index dd4f25e0..b06a2879 100644 --- a/contrib/gcl +++ b/contrib/gcl @@ -4,6 +4,7 @@ # bash programmable completion for various Common Lisp implementations by # Nikodemus Siivola +have gcl && _gcl() { local cur @@ -21,5 +22,5 @@ _gcl() fi return 0 -} -complete -F _gcl -o default gcl +} && +complete -F _gcl $default gcl diff --git a/contrib/gkrellm b/contrib/gkrellm index 913dd0f6..f044990a 100644 --- a/contrib/gkrellm +++ b/contrib/gkrellm @@ -3,6 +3,7 @@ # # gkrellm(1) completion by Guillaume Rousse +have gkrellm || have gkrellm2 && _gkrellm() { local cur prev @@ -33,5 +34,5 @@ _gkrellm() --port' -- $cur ) ) fi -} +} && complete -F _gkrellm gkrellm gkrellm2 diff --git a/contrib/gnatmake b/contrib/gnatmake index e4d4e41f..5a437874 100644 --- a/contrib/gnatmake +++ b/contrib/gnatmake @@ -3,6 +3,7 @@ # # Gnatmake completion by Ralf_Schroth@t-online.de (Ralf Schroth) +have gnatmake && _gnatmake() { local cur @@ -28,5 +29,5 @@ _gnatmake() _filedir '@(adb|ads)' fi -} -complete -F _gnatmake -o filenames gnatmake +} && +complete -F _gnatmake $filenames gnatmake diff --git a/contrib/isql b/contrib/isql index fd66af58..1ebf1726 100644 --- a/contrib/isql +++ b/contrib/isql @@ -3,11 +3,12 @@ # # isql completion by Victor Bogado da Silva Lins +have isql && _isql() { local cur cur=`_get_cword` [ -f "$ODBCINI" ] && COMPREPLY=( $( grep \\[$cur "$ODBCINI" | tr -d \\[\\] ) ) -} +} && complete -F _isql isql diff --git a/contrib/larch b/contrib/larch index 3ec04014..41b2b3f0 100644 --- a/contrib/larch +++ b/contrib/larch @@ -3,6 +3,7 @@ # # larch(1) completion by Alex Shinn +have larch && _larch() { local cur prev @@ -35,5 +36,5 @@ notify-library notify-browser push-new-revisions sendmail-mailx' $cur )) fi return 0 -} -complete -F _larch -o default larch +} && +complete -F _larch $default larch diff --git a/contrib/lisp b/contrib/lisp index be8e1f92..656b865d 100644 --- a/contrib/lisp +++ b/contrib/lisp @@ -4,6 +4,7 @@ # bash programmable completion for various Common Lisp implementations by # Nikodemus Siivola +have lisp && _lisp() { local cur @@ -22,5 +23,5 @@ _lisp() fi return 0 -} -complete -F _lisp -o default lisp +} && +complete -F _lisp $default lisp diff --git a/contrib/mcrypt b/contrib/mcrypt index 8178b5b3..9eb1226e 100644 --- a/contrib/mcrypt +++ b/contrib/mcrypt @@ -3,6 +3,7 @@ # # mcrypt(1) completion by Ariel Fermani +have mcrypt || have mdecrypt && _mcrypt() { local cur prev i decrypt @@ -76,5 +77,5 @@ _mcrypt() _filedir fi fi -} -complete -o filenames -F _mcrypt mcrypt mdecrypt +} && +complete $filenames -F _mcrypt mcrypt mdecrypt diff --git a/contrib/mtx b/contrib/mtx index 82652054..3ac0f6d3 100644 --- a/contrib/mtx +++ b/contrib/mtx @@ -3,6 +3,7 @@ # # mtx completion by Jon Middleton +have mtx && _mtx() { local cur prev options tapes drives @@ -42,5 +43,5 @@ _mtx() COMPREPLY=( $( compgen -W "$options" -- $cur ) ) fi return 0 -} +} && complete -F _mtx mtx diff --git a/contrib/p4 b/contrib/p4 index ada8a57f..002c6b79 100644 --- a/contrib/p4 +++ b/contrib/p4 @@ -3,6 +3,7 @@ # # Perforce completion by Frank Cusack +have p4 && _p4() { local cur prev prev2 p4commands p4filetypes @@ -51,5 +52,5 @@ _p4() fi return 0 -} +} && complete -F _p4 $default p4 g4 diff --git a/contrib/povray b/contrib/povray index c69b0db4..10eb68c4 100644 --- a/contrib/povray +++ b/contrib/povray @@ -3,6 +3,7 @@ # # povray completion by "David Necas (Yeti)" +have povray || have xpovray || have spovray && _povray() { local cur prev povcur pfx oext defoext @@ -55,5 +56,5 @@ _povray() return 0 ;; esac -} +} && complete -F _povray $filenames povray xpovray spovray diff --git a/contrib/ri b/contrib/ri index 9ec520c0..25c4e060 100644 --- a/contrib/ri +++ b/contrib/ri @@ -3,6 +3,7 @@ # # ri completion for Ruby documentation by Ian Macdonald +have ri && { ri_get_methods() { local regex @@ -87,3 +88,4 @@ _ri() ri_get_methods } complete -F _ri ri +} diff --git a/contrib/sbcl b/contrib/sbcl index 1b14eea3..9f722f7b 100644 --- a/contrib/sbcl +++ b/contrib/sbcl @@ -4,6 +4,7 @@ # bash programmable completion for various Common Lisp implementations by # Nikodemus Siivola +have sbcl || have sbcl-mt && _sbcl() { local cur @@ -21,5 +22,5 @@ _sbcl() fi return 0 -} +} && complete -F _sbcl $default sbcl sbcl-mt diff --git a/contrib/sitecopy b/contrib/sitecopy index 088951cd..a3322bc9 100644 --- a/contrib/sitecopy +++ b/contrib/sitecopy @@ -5,6 +5,7 @@ # Copyright 2003 Eelco Lempsink # License: GNU GPL v2 or later +have sitecopy && _sitecopy() { local cur @@ -27,5 +28,5 @@ _sitecopy() esac return 0 -} +} && complete -F _sitecopy $default sitecopy diff --git a/contrib/snownews b/contrib/snownews index 89007678..03cc6098 100644 --- a/contrib/snownews +++ b/contrib/snownews @@ -3,6 +3,7 @@ # # snownews completion by Guillaume Rousse +have snownews && _snownews() { local cur @@ -15,5 +16,5 @@ _snownews() COMPREPLY=( $( compgen -W '--update --help --version \ --disable-versioncheck -u -h -V' -- $cur)) fi -} +} && complete -F _snownews snownews diff --git a/contrib/svk b/contrib/svk index 9f2ff25b..07a430f4 100644 --- a/contrib/svk +++ b/contrib/svk @@ -3,6 +3,7 @@ # # svk completion by Guillaume Rousse +have svk && _svk() { local cur prev commands options command @@ -259,5 +260,5 @@ _svk() fi return 0 -} +} && complete -F _svk $filenames svk diff --git a/contrib/tar b/contrib/tar index dadd7886..27b56b5c 100644 --- a/contrib/tar +++ b/contrib/tar @@ -3,6 +3,7 @@ # # bash completion for GNU tar +have tar && { _tar() { local cur ext regex tar untar @@ -64,3 +65,4 @@ _tar() } [ -n "${COMP_TAR_INTERNAL_PATHS:-}" ] && complete -F _tar $dirnames tar || complete -F _tar $filenames tar +} diff --git a/contrib/unace b/contrib/unace index c6376742..d63841ad 100644 --- a/contrib/unace +++ b/contrib/unace @@ -3,6 +3,7 @@ # # unace(1) completion by Guillaume Rousse +have unace && _unace() { local cur @@ -25,5 +26,5 @@ _unace() return 0 -} +} && complete -F _unace $filenames unace diff --git a/contrib/unrar b/contrib/unrar index 9dcd2065..b467885e 100644 --- a/contrib/unrar +++ b/contrib/unrar @@ -3,6 +3,7 @@ # # unrar(1) completion by Guillaume Rousse +have unrar && _unrar() { local cur @@ -26,5 +27,5 @@ _unrar() esac return 0 -} +} && complete -F _unrar $filenames unrar diff --git a/contrib/vncviewer b/contrib/vncviewer index 933783a4..be9dc412 100644 --- a/contrib/vncviewer +++ b/contrib/vncviewer @@ -3,7 +3,7 @@ # # bash completion for vncviewer - +have vncviewer && _vncviewer_bootstrap() { local fname case "$(_realcommand vncviewer)" in @@ -21,7 +21,7 @@ _vncviewer_bootstrap() { } && complete -F _vncviewer_bootstrap vncviewer - +have tightvncviewer && _tightvncviewer() { local cur prev @@ -62,6 +62,7 @@ complete -F _tightvncviewer tightvncviewer # NOTE: - VNC Viewer options are case-insensivite. Preferred case is taken from -help. # - Both single dash (-) and double dash (--) are allowed as option prefix +have xvnc4viewer && _xvnc4viewer() { local cur prev diff --git a/contrib/wodim b/contrib/wodim index 5cac48a3..bb389712 100644 --- a/contrib/wodim +++ b/contrib/wodim @@ -3,7 +3,7 @@ # # bash completion for cdrecord/wodim -(have cdrecord || have wodim) && +have cdrecord || have wodim && _cdrecord() { local cur prev i generic_options track_options track_mode