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

Problem with _arguments and _normal as action if nolistambiguous is set.



With the sudo completion as below, I get very funny results. It does not happen
if I use _files as action instead of _normal. The arguments itself are completed
correctly (that is, command name and parameters), but sudo -TAB is at least
strange.

Again, it is 3.1.6-pws-3 with patches up to 7750

bor@itsrm2:~/.zsh.d/completion%> zsh -f
itsrm2% autoload compinit
itsrm2% fpath=($fpath ~/.zsh.d/completion)
itsrm2% compinit -D
itsrm2% setopt nolistambiguous
itsrm2% compconf describe_options=yes
itsrm2% sudo -TAB
itsrm2% sudo <=cursor here
-
-H -- set HOME environment variable
-V -- show version
-b -- run command in background
-h -- show help
-k -- remove timestamp file
-l -- list commands
-s -- run SHELL
-v -- validate timestamp file
-p  -r  -u

TAB once more

itsrm2% sudo !<=cursor
-
-H -- set HOME environment variable
-V -- show version
-b -- run command in background
-h -- show help
-k -- remove timestamp file
-l -- list commands
-s -- run SHELL
-v -- validate timestamp file
-p  -r  -u

TAB once more

itsrm2% sudo !!<=cursor
-
-H -- set HOME environment variable
-V -- show version
-b -- run command in background
-h -- show help
-k -- remove timestamp file
-l -- list commands
-s -- run SHELL
-v -- validate timestamp file
-p  -r  -u


Here is half-hearted example of sudo completion:
>
> _arguments \
> 	'-V[show version]' \
> 	'-l[list commands]' \
> 	'-h[show help]' \
> 	'-v[validate timestamp file]' \
> 	'-k[remove timestamp file]' \
> 	'-b[run command in background]' \
> 	'-r:Kerberos realm:' \
> 	'-p:prompt:' \
> 	'-u:user name:_users' \
> 	'-s[run SHELL]' \
> 	'-H[set HOME environment variable]' \
> 	'*::complete command and/or arguments:_normal'
>


/andrej



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