[patch coreutils/ touch.c] fix help

walter harms wharms at bfs.de
Tue Dec 13 16:21:14 UTC 2011



Am 13.12.2011 16:54, schrieb Denys Vlasenko:
> On Sat, Dec 10, 2011 at 3:20 PM, walter harms <wharms at bfs.de> wrote:
>> The help text did not mention -t  -- fixed
>> the BB_AUDIT SUSv3 noted -r and -t as missing -- fixed
>>
>> Signed-off-by: wharms <wharms at bfs.de>
>>
>> diff --git a/coreutils/touch.c b/coreutils/touch.c
>> index 0f980fd..d370fb4 100644
>> --- a/coreutils/touch.c
>> +++ b/coreutils/touch.c
>> @@ -7,7 +7,7 @@
>>  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
>>  */
>>
>> -/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m, -r, -t not supported. */
>> +/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m  not supported. */
>>  /* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */
>>
>>  /* Mar 16, 2003      Manuel Novoa III   (mjn3 at codepoet.org)
>> @@ -36,8 +36,9 @@
>>  //usage:       "Update the last-modified date on the given FILE[s]\n"
>>  //usage:     "\n       -c      Don't create files"
>>  //usage:       IF_DESKTOP(
>> -//usage:     "\n       -d DT   Date/time to use"
>> +//usage:     "\n       -d STRING Date/time to use"
>>  //usage:     "\n       -r FILE Use FILE's date/time"
>> +//usage:     "\n       -t [[CC]YY]MMDDhhmm[.ss] instead of current time"
>>  //usage:       )
>>  //usage:
>>  //usage:#define touch_example_usage
> 
> End result:
> 
> 
> Before:
> 
> # ./busybox touch --help
> BusyBox v1.20.0.git (2011-12-08 16:19:32 CET) multi-call binary.
> 
> Usage: touch [-c] [-d DATE] [-r FILE] FILE [FILE]...
> 
> Update the last-modified date on the given FILE[s]
> 
> 	-c	Don't create files
> 	-d DT	Date/time to use
> 	-r FILE	Use FILE's date/time
> 
> 
> After:
> 
> # ./busybox touch --help
> BusyBox v1.20.0.git (2011-12-08 16:19:32 CET) multi-call binary.
> 
> Usage: touch [-c] [-d DATE] [-r FILE] FILE [FILE]...
> 
> Update the last-modified date on the given FILE[s]
> 
> 	-c	Don't create files
> 	-d STRING Date/time to use
> 	-r FILE	Use FILE's date/time
> 	-t [[CC]YY]MMDDhhmm[.ss] instead of current time
> 
> 
> See? The option help texts are no longer aligned, and
> 
> "-t [[CC]YY]MMDDhhmm[.ss] instead of current time"
> 
> does not parse as English.
> 

I copied it from the comment below (in code).


> 
> I propose:
> 
>  //usage:#define touch_trivial_usage
> -//usage:       "[-c]" IF_DESKTOP(" [-d DATE] [-r FILE]") " FILE [FILE]..."
> +//usage:       "[-c]" IF_DESKTOP(" [-d DATE] [-t DATE] [-r FILE]") "
> FILE [FILE]..."
>  //usage:#define touch_full_usage "\n\n"
>  //usage:       "Update the last-modified date on the given FILE[s]\n"
>  //usage:     "\n       -c      Don't create files"
>  //usage:       IF_DESKTOP(
>  //usage:     "\n       -d DT   Date/time to use"
> +//usage:     "\n       -t DT   Date/time to use"
>  //usage:     "\n       -r FILE Use FILE's date/time"
>  //usage:       )
>  //usage:
> 
> Yes, -d and -t are the same. At least in bbox...
> 

I suspected but i stayed with the text from the "original".


re,
 wh



More information about the busybox mailing list