Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _powerd: add -M and -m options
- X-seq: zsh-workers 42936
- From: Eitan Adler <lists@xxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: [PATCH] _powerd: add -M and -m options
- Date: Tue, 5 Jun 2018 16:13:26 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OLu2FwcK/4ugpifug57lytBUAv+wZYC/ll/Q9B6IeXw=; b=qCZ1qmNnhyQciLRmBG3p6s9BTrcfQnBcQYGFxCdJJTZz/bwQ3DTHnbDzUklyWutnjS WrK/q5wCUwsS0Sp8u0+zeOevb4agbdzE/yqeOHKGHwxaa5oIUPNxZw2DerrYVgHBBbpu iJrRR0/DCeH75Ql9zMgOkQdkPwqOEhmWmcGjU=
- In-reply-to: <4030.1527448571@thecus>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180526070821.8661-1-lists@eitanadler.com> <4030.1527448571@thecus>
On 27 May 2018 at 12:16, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Eitan Adler wrote:
>> allowed values, limiting to numbers is good enough for now.
>>
>> Signed-off-by: Eitan Adler <lists@xxxxxxxxxxxxxx>
>> ---
>> Completion/BSD/Command/_powerd | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/Completion/BSD/Command/_powerd b/Completion/BSD/Command/_powerd
>> index 18a9fb437..88d7c401b 100644
>> --- a/Completion/BSD/Command/_powerd
>> +++ b/Completion/BSD/Command/_powerd
>> @@ -6,6 +6,8 @@ _arguments -s \
>> "-a[mode to use while on AC power]:mode:($powerd_mode)" \
>> "-b[mode to use while on battery power]:mode:($powerd_mode)" \
>> '-i[CPU idle percent level when begin to degrade performance]:percent:' \
>> + "-m[maximum frequency to throttle down to]:freq: :_guard '[0-9]#' 'numeric value'" \
>> + "-M[maximum frequency to throttle up to]:freq: :_guard '[0-9]#' 'numeric value'" \
>
> The syntax here isn't right as the : : in the middle should not be
> there. The second argument after -m or -M will give you the whole _guard
> bit as a description.
>
> What did you intend as the description? Abbreviating the word
> "frequency" to "freq" is fairly pointless and "numeric value" is not
> entirely helpful. "frequency" is better. Better still, include the units
> in round brackets and the default value in square brackets.
I copied this from the man page.
> _guard is not necessary here. _guard solves a particular problem
> that occurs when something that can't be completed but for which a
> message is useful is completed alongside something for which there are
> matches. After -m, only arguments to -m are relevant so _guard isn't
> needed.
Makes sense. I copied this from another completer. This also explains
why it didn't work exactly the way I expected :)
>
> '-m[maximum frequency to throttle down to]:frequency (MHz)'
New patch coming up shortly.
--
Eitan Adler
Messages sorted by:
Reverse Date,
Date,
Thread,
Author