summaryrefslogtreecommitdiff
path: root/completions/wvdial
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
committerDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
commit2c8171c38d87ddef31c92a76547d3fdf773a1337 (patch)
tree5e720d5a06ead72ed55454bf6647a712a761ed91 /completions/wvdial
parent9920a8faedf704420571d8072ccab27e9dac40ba (diff)
downloadbash-completion-2c8171c38d87ddef31c92a76547d3fdf773a1337.tar.gz
Imported Upstream version 1.90upstream/1.90
Diffstat (limited to 'completions/wvdial')
-rw-r--r--completions/wvdial30
1 files changed, 12 insertions, 18 deletions
diff --git a/completions/wvdial b/completions/wvdial
index 3b135f0a..da2dbfb3 100644
--- a/completions/wvdial
+++ b/completions/wvdial
@@ -1,12 +1,9 @@
-# bash completion for wvdial
+# bash completion for wvdial -*- shell-script -*-
-have wvdial &&
_wvdial()
{
- local cur prev config i IFS=$'\n'
-
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
+ local cur prev words cword split
+ _init_completion -s || return
case $prev in
--config)
@@ -15,19 +12,22 @@ _wvdial()
;;
esac
+ $split && return
+
+ local config i IFS=$'\n'
+
case $cur in
-*)
- COMPREPLY=( $( compgen -W '--config --chat \
- --remotename --help --version --no-syslog' \
- -- "$cur" ) )
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
;;
*)
# start with global and personal config files
config="/etc/wvdial.conf"$'\n'"$HOME/.wvdialrc"
# replace with command line config file if present
- for (( i=1; i < COMP_CWORD; i++ )); do
- if [[ "${COMP_WORDS[i]}" == "--config" ]]; then
- config=${COMP_WORDS[i+1]}
+ for (( i=1; i < cword; i++ )); do
+ if [[ "${words[i]}" == "--config" ]]; then
+ config=${words[i+1]}
break
fi
done
@@ -43,10 +43,4 @@ _wvdial()
} &&
complete -F _wvdial wvdial
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
# ex: ts=4 sw=4 et filetype=sh