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

Re: _os_arguments



Matthew Martin wrote on Sun, Dec 11, 2016 at 23:28:03 -0600:
> +++ b/Doc/Zsh/compsys.yo
> @@ -4624,6 +4624,60 @@ are used to store the option settings in effect before the completion
>  widget locally sets the options it needs.  Hence these functions are not
>  generally used by the completion system.
>  )
> +findex(_os_arguments)
> +xitem(tt(_os_arguments )[ var(_arguments flags) tt(:) ] {var(OS selector)|var(spec)} )

Should be item(), not xitem().  The former is for all-but-the-last when
there's more than one item() heading before a paragraph.

Add a `...' at the end to indicate the {..} group is repeatable?

Eliminate the space inside the tt()?

> +This function wraps tt(_arguments) to ease completing multiple OSes with
> +differing flags. The arguments up to the first colon are passed verbatim
> +to tt(_arguments). Following arguments are either OS selectors,
> +consisting of all uppercase letters, or tt(_arguments) specs. Each OS is
> +assigned a letter (see below). If that letter appears in an OS selector
> +since the last spec (or if there is no proceeding OS selector), the
> +following specs are passed to tt(_arguments) until the next OS selector.
> +
> +startitem()

Use startsitem()?  I think the 's' stands for 'short', which would be
more appropriate in this instance.

Add some linking sentence?  "The following OS selectors are available:".

The text implies unknown OS selectors are silently ignored, which is
good for forwards compatibility (completion functions running on an
older zsh than they target).

> +item(tt(S))(
> +Solaris
> +)
> +enditem()
> +
> +example(_os_arguments -s : \\ \
> +    '-n[number all output lines]' \\ \
> +    '-u[do not buffer output]' \\ \
> +    '(-)*:files:_files' \\ \
> +       N  '-B[use specified buffer size]:buffer size:' \\ \
> +     F N  '-l[set a lock on the stdout file descriptor]' \\ \
> +    DFMNO '-v[display non-printing chars as ^X or M-a]'
> +)

Missing ')'.  Also, consider adding a prose description of what the
example code does.

The yodl looks good; haven't reviewed the functions.

Cheers,

Daniel

>  findex(_parameters)
>  item(tt(_parameters))(
>  This is used to complete the names of shell parameters.
> 



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