Util-Linux package development
 help / color / mirror / Atom feed
From: J William Piggott <elseifthen@gmx.com>
To: Ruediger Meier <sweet_f_a@gmx.de>
Cc: Karel Zak <kzak@redhat.com>, util-linux@vger.kernel.org
Subject: Re: [PATCH 2/2] hwclock: fix regression from c3ae785
Date: Tue, 18 Jul 2017 21:20:56 -0400	[thread overview]
Message-ID: <b13f5e0a-368c-8c8f-6abc-b5d60d6f48b1@gmx.com> (raw)
In-Reply-To: <201707182233.42270.sweet_f_a@gmx.de>



On 07/18/2017 04:33 PM, Ruediger Meier wrote:
> On Tuesday 18 July 2017, J William Piggott wrote:
>> hwclock --get foobar
>> hwclock: 3 too many arguments given
>>
>> Fixed:
>>
>> hwclock --get foobar
>> hwclock: 1 too many arguments given
>>
>> Signed-off-by: J William Piggott <elseifthen@gmx.com>
>> ---
>>  sys-utils/hwclock.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
>> index 9745158..9b313cf 100644
>> --- a/sys-utils/hwclock.c
>> +++ b/sys-utils/hwclock.c
>> @@ -1448,9 +1448,10 @@ int main(int argc, char **argv)
>>  		}
>>  	}
>>
>> -	if (argc > optind) {
>> +	argc -= optind;
>> +	if (argc > 0) {
>>  		warnx(_("%d too many arguments given"), argc);
> 
> Oops, sorry for this regression ;)
> 
> Anyways, at least for me "1 too many arguments given" does not sound 
> really understandable.  Maybe we don't need that number at all!?
>

I don't how it would be misunderstood, it's pretty straight forward
language.

I think the number could be helpful for complex commands like:

hwclock --predict --date jan 10 2017 --utc foo --noadjfile
hwclock: 3 too many arguments given


> 
>> -		errtryhelp(EXIT_FAILURE);
>> +		errtryhelp(EX_USAGE);
> 
> What about changing also the last other errtryhelp(EXIT_FAILURE) to 
> EX_USAGE, 5 lines above?

Good point. Pushed the change.

> 
> 
>>  	}
>>
>>  	if (!ctl.adj_file_name)
>> --
>> To unsubscribe from this list: send the line "unsubscribe util-linux"
>> in the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2017-07-19  1:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 19:59 [PATCH 0/2] Pull Request J William Piggott
2017-07-18 20:00 ` [PATCH 1/2] hwclock: remove unused epoch_option J William Piggott
2017-07-18 20:01 ` [PATCH 2/2] hwclock: fix regression from c3ae785 J William Piggott
2017-07-18 20:33   ` Ruediger Meier
2017-07-18 20:46     ` Ruediger Meier
2017-07-19  1:25       ` J William Piggott
2017-07-19  1:20     ` J William Piggott [this message]
2017-07-20  1:14   ` [v3 PATCH " J William Piggott

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=b13f5e0a-368c-8c8f-6abc-b5d60d6f48b1@gmx.com \
    --to=elseifthen@gmx.com \
    --cc=kzak@redhat.com \
    --cc=sweet_f_a@gmx.de \
    --cc=util-linux@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox