Ralph Corderoy <[email protected]> writes:
> I did work out the tcsh(1) spell for that in another millenium, these
> days I use bash as it's what to hand.  I've had a go at what you
> requested and it seems to work;  I don't use it myself and haven't tried
> to define a bash completion before so be warned.

This has been on my list of things to work out how to do for
years; thanks for saving me the trouble!

>     comp_nmh_folder() 
>     { 
>         local w=${COMP_WORDS[COMP_CWORD]} &&
>         [[ $w == +* ]] && w=${w#+} &&
>         COMPREPLY=($(
>             folders -fast |

If you have the sort of folder structure I do, that wants to be

              folders -fast -recurse |

>             awk -v "w=$w" -v "l=${#w}" 'substr($0, 1, l) == w'
>         ))
>     }
>     complete -P + -F comp_nmh_folder -D

-- 
Jón Fairbairn                                 [email protected]



_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to