Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _powerd: add -M and -m options
- X-seq: zsh-workers 42868
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Eitan Adler <lists@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH] _powerd: add -M and -m options
- Date: Sun, 27 May 2018 21:16:11 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1527448577; bh=R5H+y/rW3vtJa2amDrzOMt0gicXLXlrwmlq9vz4u53w=; h=From:References:To:Subject:Date:From:Subject; b=bNl9G4PpaM6pbxsLe+wX09I0EH1kdKEhQz1xU+n5v8A8lboE1Z20gAaUAluB63ERVEL8eKVVJHrKyWdrGOu6shQDMiaiS4y6LZjf2dFnbXxZJRnxUOGJ0cwYMZ/sYeSCwFRQ+766zgy9HJxAuu6ul/wbTYZChuH6KjHwtNR4ApuBwy66vsQpYrpdyqJrB+xoTozo0u+vLNmnjymfrUtMGPpHU+BFSLfySd5FS+CpFXubI2XQYv0vr7ro/pOD+tszf3d+TC4hYGI6mf/Oc3r6HgLrCeHAGZlA81qqV6m9My2x3RrDgSIW/FUjoe5BIeH1+ILX/vvcjuAhAYp9LA4H2A==
- In-reply-to: <20180526070821.8661-1-lists@eitanadler.com>
- 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>
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.
_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.
Assuming the units are MHz, this leaves something like:
'-m[maximum frequency to throttle down to]:frequency (MHz)'
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author