[Bash-completion-devel] wget completion
gibboris at gmail.com
gibboris at gmail.com
Thu Oct 22 13:00:15 UTC 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wget.3.sh
Type: application/x-sh
Size: 3762 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20091022/a080e5a1/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wget.4.sh
Type: application/x-sh
Size: 5193 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20091022/a080e5a1/attachment-0001.sh>
More information about the Bash-completion-devel
mailing list