From dc4838bad9aedf240fb750247930ac93a98b0ba0 Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Tue, 1 Oct 2002 06:55:38 +0000 Subject: [PATCH] - links completion by Alan Ford --- bash_completion | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index d7a38337..df60fbbb 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05b # -# $Id: bash_completion,v 1.417 2002/10/01 08:07:33 ianmacd Exp $ +# $Id: bash_completion,v 1.418 2002/10/01 08:55:38 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -77,7 +77,7 @@ complete -f -X '!*.@(mid?(i))' timidity playmidi complete -f -X '*.@(o|so|so.*|a|tar|tgz|tbz2|rpm|zip|ZIP|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mpg|MPG|avi|AVI|asf|ASF|ogg|OGG)' vi vim gvim emacs complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR)' wine complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme -complete -f -X '!*.@(htm?(l))' netscape mozilla lynx opera w3m galeon links curl dillo elinks +complete -f -X '!*.@(htm?(l))' netscape mozilla lynx opera w3m galeon curl dillo elinks # FINISH exclude -- do not remove this line # start of section containing compspecs that can be handled within bash @@ -3799,6 +3799,41 @@ _lilo() } [ "$have" ] && complete -F _lilo lilo +# links completion +# +have links && +_links() +{ + local cur + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + case "$cur" in + --*) + COMPREPLY=( $( compgen -W '--help' -- $cur ) ) + ;; + -*) + COMPREPLY=( $( compgen -W '-async-dns -max-connections \ + -max-connections-to-host -retries \ + -receive-timeout -unrestartable-receive-timeout\ + -format-cache-size -memory-cache-size \ + -http-proxy -ftp-proxy -download-dir \ + -assume-codepage -anonymous -dump -no-connect \ + -source -version -help' -- $cur ) ) + ;; + *) + COMPREPLY=( $( compgen -W '$( < ~/.links/links.his )' \ + -- $cur ) ) + _filedir '@(htm|html)' + return 0 + ;; + esac + + return 0 +} +[ "$have" ] && complete -F _links $filenames links + _filedir_xspec() { local IFS cur xspec