zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-users@zsh.org
Subject: Re: completion for 'alerter'
Date: Fri, 6 Mar 2020 16:21:30 +0100	[thread overview]
Message-ID: <CAHYJk3QOv=Gfk4+spsQGUxAGSm4PEH_0141cP2v_=f7U7TxQTA@mail.gmail.com> (raw)
In-Reply-To: <1583488261.4530.3.camel@samsung.com>

On 3/6/20, Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Thu, 2020-03-05 at 23:45 -0500, TJ Luoma wrote:
>> These are the options for `alerter`
>>
>> -help
>> -json
>> -message VALUE
>> -remove ID
>> -list ID
>> -reply VALUE
>> -actions VALUE1,VALUE2
>> -dropdownLabel VALUE
>> -title VALUE
>> -subtitle VALUE
>> -closeLabel VALUE
>> -sound NAME
>> -group ID
>> -sender ID
>> -appIcon URL
>> -contentImage URL
>> -timeout NUMBER
>
> Best thing to do for something like this is to copy another
> straightforward completion.  For example, a search for something that
> handles '-help' reveals Completion/Unix/Command/_tardy in the zsh
> distribution --- it doesn't get much simpler than that.  All you really
> need to know here is that if there is a colon, the thing immediately
> after the colon describes the argument; if there are two colons, the
> stuff after the second is completion of the argument (e.g. your VALUE or
> ID); the stuff in parentheses is literal value to be completed, and the
> things beginning "_" are completion functions to be called to add the
> values.  There are functions you can call for pretty much anything
> generic e.g. _urls for (surprise!) URLs.  Copy it to _alerter, change
> the line at the top to say "#compdef _alerter", change the list of
> options, and that's it basically working.

A minor correction that this should say "#compdef alerter" without the
underscore, or it would just complete options to the completer.

-- 
Mikael Magnusson

      reply	other threads:[~2020-03-06 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200306044721eucas1p2ef2d8e761171b32b9c49ac98cd8fce8b@eucas1p2.samsung.com>
2020-03-06  4:45 ` TJ Luoma
2020-03-06  9:51   ` Peter Stephenson
2020-03-06 15:21     ` Mikael Magnusson [this message]

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='CAHYJk3QOv=Gfk4+spsQGUxAGSm4PEH_0141cP2v_=f7U7TxQTA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-users@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).