[pacman-dev] [PATCH 1/2] zsh_completion: Add --asdeps/--asexplicit to -U options
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in index 1cae1de..69485f5 100644 --- a/contrib/zsh_completion.in +++ b/contrib/zsh_completion.in @@ -41,6 +41,8 @@ _pacman_opts_pkgfile=( '--dbonly[Only remove database entry, do not remove files]' '--force[Overwrite conflicting files]' '--needed[Do not reinstall up to date packages]' + '--asdeps[mark packages as non-explicitly installed]' + '--asexplicit[mark packages as explicitly installed]' '*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"' ) -- 2.6.1
Completion now works as expected with a comma-separated sequence. Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in index 69485f5..0db26b2 100644 --- a/contrib/zsh_completion.in +++ b/contrib/zsh_completion.in @@ -252,23 +252,36 @@ _pacman_completions_all_groups() { _pacman_get_command groups=( $(_call_program groups $cmd[@] -Sg) ) typeset -U groups - compadd "$@" -a groups + + if [[ ${words[CURRENT-1]} == '--ignoregroup' ]]; then + _sequence compadd -S ',' "$@" -a groups + else + compadd "$@" -a groups + fi } # provides completions for packages available from repositories # these can be specified as either 'package' or 'repository/package' _pacman_completions_all_packages() { - local -a cmd packages repositories packages_long + local -a seq sep cmd packages repositories packages_long _pacman_get_command + if [[ ${words[CURRENT-1]} == '--ignore' ]]; then + seq='_sequence' + sep=(-S ',') + else + seq= + sep=() + fi + if compset -P1 '*/*'; then packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) ) typeset -U packages - _wanted repo_packages expl "repository/package" compadd ${(@)packages} + ${seq} _wanted repo_packages expl "repository/package" compadd ${sep[@]} ${(@)packages} else packages=( $(_call_program packages $cmd[@] -Sql) ) typeset -U packages - _wanted packages expl "packages" compadd - "${(@)packages}" + ${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}" repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options}) typeset -U repositories -- 2.6.1
On 23/10/15 08:38, Mohammad Alsaleh wrote:
Completion now works as expected with a comma-separated sequence.
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
This looks fine to me, but I don't know anything about zsh completion. Is there anyone else that can review? Thanks, Allan
I can review it tomorrow. On Mon, Oct 26, 2015 at 11:06 PM Allan McRae <allan@archlinux.org> wrote:
On 23/10/15 08:38, Mohammad Alsaleh wrote:
Completion now works as expected with a comma-separated sequence.
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
This looks fine to me, but I don't know anything about zsh completion.
Is there anyone else that can review?
Thanks, Allan
Ping! It now a week + tomorrow. On 27/10/15 14:07, Daniel Wallace wrote:
I can review it tomorrow.
On Mon, Oct 26, 2015 at 11:06 PM Allan McRae <allan@archlinux.org> wrote:
On 23/10/15 08:38, Mohammad Alsaleh wrote:
Completion now works as expected with a comma-separated sequence.
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
This looks fine to me, but I don't know anything about zsh completion.
Is there anyone else that can review?
Thanks, Allan
Sorry, I got super busy that morning and forgot. I verified it last night +1. On Mon, Nov 2, 2015 at 10:46 PM, Allan McRae <allan@archlinux.org> wrote:
Ping! It now a week + tomorrow.
On 27/10/15 14:07, Daniel Wallace wrote:
I can review it tomorrow.
On Mon, Oct 26, 2015 at 11:06 PM Allan McRae <allan@archlinux.org> wrote:
On 23/10/15 08:38, Mohammad Alsaleh wrote:
Completion now works as expected with a comma-separated sequence.
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
This looks fine to me, but I don't know anything about zsh completion.
Is there anyone else that can review?
Thanks, Allan
On 23/10/15 08:38, Mohammad Alsaleh wrote:
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> --- contrib/zsh_completion.in | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in index 1cae1de..69485f5 100644 --- a/contrib/zsh_completion.in +++ b/contrib/zsh_completion.in @@ -41,6 +41,8 @@ _pacman_opts_pkgfile=( '--dbonly[Only remove database entry, do not remove files]' '--force[Overwrite conflicting files]' '--needed[Do not reinstall up to date packages]' + '--asdeps[mark packages as non-explicitly installed]' + '--asexplicit[mark packages as explicitly installed]' '*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"' )
Ack. Allan
participants (3)
-
Allan McRae
-
Daniel Wallace
-
Mohammad Alsaleh