[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cut manpage is buggy
From: |
Jim Meyering |
Subject: |
Re: cut manpage is buggy |
Date: |
Mon, 16 Apr 2007 16:26:31 +0200 |
Eric Blake <address@hidden> wrote:
> According to Rudolf Kastl on 4/5/2007 6:33 AM:
>> Hello to you!
>>
>> actually the cut manpage has a bug in it:
>
> Which is generated from 'cut --help', but that has the same problem.
>
>>
>> SYNOPSIS
>> cut [OPTION]... [FILE]...
>>
>> implies that it does need neither an option set nor files listed.
>
> Whereas POSIX lists three synopses, and later in 'cut --help' mentions
> that cut requires exactly one of -b, -c, or -f (unless you are using
> --help or --version).
>
> How about this for a patch:
...
> -Usage: %s [OPTION]... [FILE]...\n\
> +Usage: %s -b LIST [OPTION]... [FILE]...\n\
> + or: %s -c LIST [OPTION]... [FILE]...\n\
> + or: %s -f LIST [OPTION]... [FILE]...\n\
Thanks for the suggestion, but I prefer simply to remove
the brackets to indicate that an OPTION is required.
* src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
Reported by Rudolf Kastl.
diff --git a/src/cut.c b/src/cut.c
index bf468fe..0883e72 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -1,5 +1,5 @@
/* cut - remove parts of lines of files
- Copyright (C) 1997-2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2007 Free Software Foundation, Inc.
Copyright (C) 1984 David M. Ihnat
This program is free software; you can redistribute it and/or modify
@@ -186,7 +186,7 @@ usage (int status)
else
{
printf (_("\
-Usage: %s [OPTION]... [FILE]...\n\
+Usage: %s OPTION... [FILE]...\n\
"),
program_name);
fputs (_("\