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

Re: [PATCH] _virsh (Was: Re: zsh virsh completion)



Oliver Kiddle wrote on Sat, Sep 10, 2016 at 00:09:45 +0200:
> @@ -13,10 +20,10 @@ if zstyle -s ":completion:${curcontext}:${1}" command tmp; then
>    if [[ "$tmp" = -* ]]; then
>      eval "$tmp[2,-1]" "$argv[2,-1]"

Document somewhere that that _call_program -p overrides the 'command'
style if the latter's value starts with a hyphen?

>    else
> -    eval "$tmp"
> +    eval $prefix "$tmp"
>    fi
>  else
> -  eval "$argv[2,-1]"
> +  eval $prefix "$argv[2,-1]"
>  fi 2>&$err_fd

> +The standard variables are:
> +
> +startitem()
> +item(tt(_comp_caller_options))(
> +The completion system uses tt(setopt) to set a number of options. This
> +allows functions to be written without concern for compatibility with
> +every possible combination of user options. However, sometimes completion
> +needs to know what the user's option preferences are. These are saved
> +in the tt(_comp_caller_options) associative array.

As I said in 39168:

    What are the keys and values of the array?  Suggested text:
    
        The array maps option names, spelled in lowercase without
        underscores, to the string `tt(on)' or `tt(off)'.

> +item(tt(_comp_priv_prefix))(
> +Completion functions such as tt(_sudo) can set the tt(_comp_priv_prefix)
> +array to a command that may then be used by tt(_call_program) to
> +match the privileges when calling programs to generate matches.

I suggeted in 39168 the following:

s/command/prefix command/ in order to clarify to completion function
authors what they should set $_comp_priv_prefix to.

> +)

Cheers,

Daniel



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