zsh-workers
 help / color / mirror / code / Atom feed
From: Kovid Goyal <kovid@kovidgoyal.net>
To: zsh-workers@zsh.org
Subject: Bug in sudo completions
Date: Tue, 31 Oct 2023 06:23:41 +0530	[thread overview]
Message-ID: <ZUBQFQLwWw6cSnJH@qedette> (raw)

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
_____________________________________


             reply	other threads:[~2023-10-31  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31  0:53 Kovid Goyal [this message]
2023-10-31 18:48 ` Oliver Kiddle
2023-11-01 16:16   ` Kovid Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZUBQFQLwWw6cSnJH@qedette \
    --to=kovid@kovidgoyal.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).