[pacman-dev] [PATCH] zsh_completion: Add proper completion for --ignore and --ignoregroup (v2)

Dan McGee dpmcgee at gmail.com
Wed Jan 20 00:13:37 EST 2010


On Tue, Dec 15, 2009 at 1:11 PM, Nezmer <Nezmer at allurelinux.org> wrote:
> This patch provides proper comma-separated completions for --ignore and --ignoregroup
>
> Signed-off-by: Nezmer <Nezmer at allurelinux.org>
> ---

Is this the one I should be looking at? I *hate* patch resubmits
without explanation, especially when the subject gets a "v2" in it
that I am going to have to manually clean up later after I git-am the
patch.

If you don't mind, please submit the "one true version" of this patch
and put your comments here if you don't think they belong in the final
commit message. Anything after the triple dash will get trimmed by git
but is available to us on the ML.

Thanks!

-Dan

>  contrib/zsh_completion |   26 +++++++++++++++++++++++---
>  1 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/zsh_completion b/contrib/zsh_completion
> index 2f43d9b..b751c82 100644
> --- a/contrib/zsh_completion
> +++ b/contrib/zsh_completion
> @@ -86,9 +86,9 @@ _pacman_opts_sync_modifiers=(
>        '-w[Download packages only]'
>        '-y[Download fresh package databases]'
>        '*--ignore[Ignore a package upgrade]:package:
> -               _pacman_completions_all_packages'
> -       '*--ignoregroup[Ignore a group upgrade]:package group:
> -               _pacman_completions_all_groups'
> +               _pacman_completions_ignore_packages'
> +       '*--ignoregroup[Ignore a group upgrade]:group:
> +               _pacman_completions_ignore_groups'
>        '--asdeps[Install packages as non-explicitly installed]'
>        '--asexplicit[Install packages as explicitly installed]'
>  )
> @@ -240,6 +240,26 @@ _pacman_completions_all_packages() {
>        fi
>  }
>
> +# provides comma-separated completions for packages available from repositories
> +# to be used with --ignore
> +_pacman_completions_ignore_packages() {
> +       local -a cmd packages
> +       _pacman_get_command
> +       packages=($(pacman -Slq))
> +       typeset -U packages
> +       _wanted packages expl "packages" _values -s "," compadd - "${(@)packages}"
> +}
> +
> +# provides comma-separated completions for package groups to be used
> +# with --ignoregroup
> +_pacman_completions_ignore_groups() {
> +       local -a cmd groups
> +       _pacman_get_command
> +       groups=($(pacman -Sg))
> +       typeset -U groups
> +       _wanted groups expl "groups" _values -s "," compadd - "${(@)groups}"
> +}
> +
>  # provides completions for package groups
>  _pacman_completions_installed_groups() {
>        local -a cmd groups
> --
> 1.6.5.6
>
>
>


More information about the pacman-dev mailing list