Reworked on the wget completion.
One for bash4, the other backward compatible.
If you look at the comments you'll see my
philosophical questions / changelog :

1) For handling long options with bash4 :
_longopt = ; compopt -o nospace
Then at the beginning, before 'case "${prev}"' :
    cur=`_get_cword =`
    prev=${COMP_WORDS[COMP_CWORD-1]}
    if [[ "$cur" == --*=* ]]; then
        prev=${cur/=*}
        cur=${cur/*=}
    fi
Is that the right way to do ?

2) There is some times since I wish to have a kind of automatic exclusive, eg:
_uniq_opt "--plop --zob"
which alias to compgen -X "@(${1// /|=)" or something like that.
Any thoughts ? can we push it to :
_exclusive_opts "--windows" "--unix"
which alias to compgen -X "@($1|$2)" IF [[ $CMDLINE =~ $1|$2 ]] ?

To complete, with respect to mutual exclusivity, a comma-separated list, I went
to use compgen -P (prefix) with the list-beginning which not a nice way to
do, any suggestion ? I wasn't able neither to use +o nospace (space appended) 
only
when the last available option as been added (so subtle :))

3) The case syntax as been refactored, a bug as been corrected for --level

4) --restrict-file-names as been updated to match wget 1.12 (but see 2) ^^)

5) which behavior to use when completing - :
- short option
- long option (directly)

6) about the ':' breaking {http{s,},ftp}:// completion, there is two ways.
Which one should I seriously consider.

any advices welcomed.

Raph

Attachment: wget.3.sh
Description: Bourne shell script

Attachment: wget.4.sh
Description: Bourne shell script

_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to