Hi all, I was studying the completion system and, since I would like to add support for -M for the _man completion, I've done it. Dirty and ugly patch is attached. Anyway, here comes some inline considerations: + if (( $words[(I)-M] == (( $CURRENT - 1 )) )); then + _directories && return 0 + fi + Here I wanted to check if the cursor position (where the user will hit tab) will be just after the -M option. If true, it complete for directories and exit. Is it right? Is there any better way to make that check? First I tried to use the _arguments function, but I realized that _arguments is just an easy layer for what happens behind the scenes and _man (and other completion functions) use the "behind the scenes" way to make things work. + if (( $words[(I)-M] )); then + local opt + opt=$words[(( $words[(I)-M]+1 ))] + _manpath=($_manpath $opt) + fi + _man sets a local MANPATH to make man look for man pages in the right places. If the user set a man path with -M, I want it to be added to the _manpath variable. I'm just not sure if it is the better way to do it. opt holds the option passed to the -M flag, but (( $words[(I)-M]+1 )) looks ugly? If it is all right, can it be pulled upstream? Thank you very much! -- Silas Silva