Age | Commit message (Collapse) | Author |
|
|
|
--first-only option string from its description, so help2man formats
the derived man page properly.
|
|
a type, not a value.
|
|
(writeline): Remove stream arg; we now always output to stdout.
All callers changed.
(check_file): Reuse stdout rather than opening a new stream.
This saves a file descriptor.
|
|
|
|
|
|
|
|
(check_file): Don't assume fopen cannot return stdin or stdout.
|
|
|
|
|
|
|
|
|
|
only the first line.
$ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
1 1
1 2
(main): Interpret `uniq -f1 -1' like `uniq -f1', not like `uniq -f11'.
|
|
|
|
|
|
|
|
main): Use bool for booleans.
(writeline, check_file): Use uintmax_t for line counts.
(check_file): Check for and report line number overflow,
when that matters.
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
so that the proper errno value is used.
(check_file): Check for ferror (stdout) even if ostream == stdout.
(check_file): Don't report bogus errno value
after ferror discovers an output error. We don't know the proper
errno value, since it might have been caused by any of a whole
bunch of calls, and it might have been trashed in the meantime.
Fixing this problem will require much more extensive changes;
in the meantime just say "write error".
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
Don't include closeout.h.
|
|
count and the corresponding line, as required by POSIX.
|
|
|
|
|
|
must output nothing. Problem reported by Josh Hyman.
(enum output_mode, mode): Remove, replacing with:
(output_unique, output_first_repeated, output_later_repeated):
New vars. All uses of "mode" changed to use these variables,
which are not mutually exclusive as "mode" was.
(writeline): New arg "match", used to control whether to
obey output_first_repeated or output_later_repeated.
All callers changed.
(check_file, main): Adjust to above changes.
|
|
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
(hard_LC_COLLATE): New var.
(different): Args are now char *, not const char *.
Use xmemcoll instead of memcmp to compare lines, so that
LC_COLLATE has effect. However, use memcmp if it is an
easy locale.
(check_file): Do not include newline in comparison, so that
xmemcoll has a byte to stomp on temporarily.
(main): Set hard_LC_COLLATE.
|
|
|
|
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(shortopts): Remove; no longer needed.
(main): Parse options using POSIX 1003.1-2001 rules if
conforming to that standard. Do not warn of obsolete options.
|
|
consistent with all of the other `... is obsolete...' diagnostics.
|
|
support of obsolete "-N" option syntax in expand, head, fold,
split, tail, unexpand, uniq, and which prohibits options with
optional arguments in od and pr.
(usage): Document this.
(shortopts): New constant.
(main): Check for obsolete options.
|
|
|
|
|
|
support of obsolete "+" option syntax in sort, tail, and uniq.
(usage, main): Implement this.
|
|
|
|
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
|
|
instead of hard-coding --help and --version descriptions.
|
|
Split usage strings so that --help and --version descriptions are alone
in their own string.
Likewise for the one that says:
Mandatory arguments to long options are mandatory for short options too.
|
|
Use fputs, not printf.
|
|
``Mandatory arguments to long options are mandatory for short options too.\n\''
|
|
* src/uniq.c (enum delimit_method): s/DM_PRECEDE/DM_PREPEND/
and change all uses.
(delimit_method_string): s/precede/prepend/
Patch by Padraig Brady.
* src/uniq.c (usage): Correct typo in description of --all-repeated.
Patch by Padraig Brady.
|
|
a bounds check for examples like `uniq a b c'.
|
|
(e.g. `uniq +3 --' did not work) by invoking getopt_long with
leading '-', resembling what was done to 'sort' on 2001-03-20.
Recognize an +N option only if it is an integer in range, and
(if POSIXLY_CORRECT) only if a file name argument has not been seen;
otherwise silently treat it as a file name.
If the user specifies too many operands, output the first one
in the error message, as a diagnostic aid.
|
|
|
|
into size_t. Tune code for the common case where the line
lengths differ: we avoid comparing them entirely in that case.
|