Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fix zstyle context handling
- X-seq: zsh-workers 33522
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: PATCH: fix zstyle context handling
- Date: Fri, 24 Oct 2014 08:58:49 +0200
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=m0BiXYGrcSnZ4x4Qkqg3Z1eZMgfzLbQqMo7WePrV0tY=; b=HZ3DXeVNo3Sx2q8+UTpBXlZJZVJrMbfCtO6HvlAnO5L8rzAh5y9R4FYjHDpCcFKQ9J Z1Ol/G02C+rEDy7HytqwYv3KuWHTGpxihV66hnMs7W2Cq+p6d8DCG44booNKyxFcEuWP 2HxpfhGWxKQGki969582B+c8bP8H2vbbtSJlU9xJyL3clTuw/pFe9l9daNTfjkRFw5NR iggjzDcxuJGWusTVtA/J1CtO3Xar7cOuTjrkJUFrtJSHASYNe9GyYntHZNp2T7pmpEzp slb8TTvFN2dL4u+xJ4RjBXENMEv7MrUw5JFjdtR6lhM9kYN+KfBZ4UG2BXOHv4WxOvV3 wIRg==
- In-reply-to: <21255.1413916480@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <21255.1413916480@thecus.kiddle.eu>
On Tue, Oct 21, 2014 at 8:34 PM, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> As I mentioned last week, bad handling of zstyle contexts with
> _arguments/_values is not uncommon in our completion functions. I had
> made a note of offending functions at the time and this patch fixes many
> cases.
>
> Oliver
>
> diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su
> index 6d0f2cd..989aa96 100644
> --- a/Completion/Unix/Command/_su
> +++ b/Completion/Unix/Command/_su
> @@ -1,9 +1,9 @@
> #compdef su
>
> local -A opt_args
> -local -a args state context
> +local -a args context state line expl
> local shell=${words[(i)(-s|--shell=*)]} first='1:user name:_users'
> -local usr=root line
> +local usr=root
>
> if _pick_variant gnu="Free Software Foundation" unix --version; then
> args=(
> @@ -20,10 +20,20 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then
> )
> else
> args=(
> - '-c[pass command to shell]:command string:->command'
> '-l[use a login shell]'
> '-s[run the specified shell]:shell:->shell'
> )
> + case $OSTYPE in
> + freebsd*)
> + args=(
> + '-c[use settings from specified login class]:class'
> + '-f[if the invoked shell is csh, prevent it from reading ,cshrc]'
> + '-l[use a login shell]'
> + '-m[do not reset environment]'
> + '-s[set the MAC label]'
> + )
> + *) args+=( '-c[pass command to shell]:command string:->command' ) ;;
> + esac
> fi
>
> if [[ $#words -ge 2 && $words[2] != -* && CURRENT -ne 2 ]]; then
Missing a ;; after the freebsd* case, caused a parse error when
zcompiling my $fpath. I've committed the fix.
Thanks for looking through and fixing all of this by the way, it must
have been quite an effort.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author