Hi,
I sometimes have to use the mount options
manually (eg, -o ro,users, ...)
I would like to know if there are any plans to
move it outside _the venerable_ bash_completion script.

To do this option completion (if it's interesting enough) it needs :

I) get the fstype, so grab the -t option in the commandline
   1) does a __get_opt_value [--long=[separator]|--short] option_name
   would be nice ?

   2) fstype="$(__get_opt_value --short -t)"

II) get options of this fstype
   1) with an associative array like :
   declare -A allfstypes;
   allfstypes[adfs]=uid,ownmask;
   allfstypes[ext3]=....;
   ...
   allfstypes[common]=async,atime,...;

III)
   elif [[ "$prev" == -o ]] && [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
        cur optval=_get_cword ,
        local compstr=${fstypes[$allfstypes]},${fstypes[common]}
        COMPREPLY=( $(compgen -W "${compstr//,/ }" -- "$optval" )

I also noticed something (I'm probably not the first but I did't see bug 
reports about that) :
$ ls
[ then go at the beginning of the line ]
[ then press <tab> ]
bash: COMP_WORDS: bad array index

With $ mount, it adds :
bash: [: = : unary operator expected [twice]

Raph

_______________________________________________
Bash-completion-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to