zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: _os_arguments
Date: Mon, 12 Dec 2016 08:52:58 +0000	[thread overview]
Message-ID: <20161212085258.GB11457@fujitsu.shahaf.local2> (raw)
In-Reply-To: <20161212052803.GA53519@CptOrmolo.darkstar>

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.
> 


  reply	other threads:[~2016-12-12  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12  5:28 _os_arguments Matthew Martin
2016-12-12  8:52 ` Daniel Shahaf [this message]
2016-12-13  0:54 ` _os_arguments Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161212085258.GB11457@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).