Bugzilla – Bug 1200467
zsh completion script for zypper does not account for global options
Last modified: 2023-08-07 03:03:09 UTC
The zsh completion script (/usr/share/zsh/functions/Completion/openSUSE/_zypper) does not handle global options prior to the command. For example if you type % zypper search and then hit <tab> it gives you the valid options for the search command. If on the other hand if you type (the perfectly valid): % zypper --no-refresh search and hit tab, it doesn't give any valid options even though it should give the same options as in the first example. If you type: % zypper and hit tab, it correctly lists the available global options along with the commands but if you enter one of the global options it will not do any further completion.
Created attachment 859721 [details] New version of the file
Created attachment 859722 [details] Patch created with diff -c
Added a possible new version of the completion file. I don't do a massive amount of zsh scripting so I'm not sure if this is the optimal or preferred way of doing this but it works for my test cases.