Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug in sudo completions



Completions for sudo fail when specifying environment variables on the
command line. For example:

sudo a=1 ls -<TAB>

gives

No matches for: `file'

while 

sudo ls -<TAB>

gives

zsh: do you wish to see all 171 possibilities (58 lines)?

This is likely because the completions script thinks any argument not
starting with - means the program to complete, which is not true.
Quoting from man sudo

sudo  [-ABbEHnPS]  [-C  num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i | -s]
            [command [arg ...]]

Note that VAR=value can occur before -i or -s and before command.

-- 
_____________________________________

Dr. Kovid Goyal 
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________




Messages sorted by: Reverse Date, Date, Thread, Author