zsh-workers
 help / color / mirror / code / Atom feed
* Bug in sudo completions
@ 2023-10-31  0:53 Kovid Goyal
  2023-10-31 18:48 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Kovid Goyal @ 2023-10-31  0:53 UTC (permalink / raw)
  To: zsh-workers

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
_____________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-01 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31  0:53 Bug in sudo completions Kovid Goyal
2023-10-31 18:48 ` Oliver Kiddle
2023-11-01 16:16   ` Kovid Goyal

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).