From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20821 invoked by alias); 5 Jun 2018 23:14:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42936 Received: (qmail 10787 invoked by uid 1010); 5 Jun 2018 23:14:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-yb0-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.196):SA:0(-1.9/5.0):. Processed in 0.554073 secs); 05 Jun 2018 23:14:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: lists@eitanadler.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OLu2FwcK/4ugpifug57lytBUAv+wZYC/ll/Q9B6IeXw=; b=LTbxZgJvOhueQu1SCHw8J75/u/7LokgiZMsmHVKsItIgWwteWcKsnxWF8esVtTFL7S qDFeYydNXwA3+/TKBN37z2MzafIvTTpRW6F9xtC0cg/4E/tkqbkLDJELArvmzNYk+IGT mFQjECqvYPCb+5qRQctrqZ3w/jET3l3mMC4NXsyMPpIDrIW5qlWzarpwTMmmNMIxsXS+ LBCWSyst6z4t2Y0IAkXIkZrMaFQVCh7zPvRQ/9MQvPF1JfYNMkxiMRgIvY30JqmZ9mD2 Xr5k8al349IxP8ja0Xy8f9HoypVz9eDzu3ze7CJfnmR8F77uVAOlyA3gQozNejKF+vss xTdQ== X-Gm-Message-State: APt69E0CnMHm5lWeI5VM2BA6SrGIQ1cvk1/9oIW247lBLMC8V9l+7icd Q0Y8UKDpZGpRkuMswtKHGDK8F8Wehc/+bAo8ag1GwA== X-Google-Smtp-Source: ADUXVKLmhULG4gH4bunzdGWqQtOcV6VlTTxZDINJRNUPZJpf768bJvCJ6hfG4PXmNN0xSkzP7dh8mVwK12an8Ez+GLE= X-Received: by 2002:a25:500a:: with SMTP id e10-v6mr328731ybb.87.1528240436641; Tue, 05 Jun 2018 16:13:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4030.1527448571@thecus> References: <20180526070821.8661-1-lists@eitanadler.com> <4030.1527448571@thecus> From: Eitan Adler Date: Tue, 5 Jun 2018 16:13:26 -0700 Message-ID: Subject: Re: [PATCH] _powerd: add -M and -m options To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On 27 May 2018 at 12:16, Oliver Kiddle wrote: > Eitan Adler wrote: >> allowed values, limiting to numbers is good enough for now. >> >> Signed-off-by: Eitan Adler >> --- >> 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