* src/system.h (oputs_): Map md5sum etc. to cksum urls,
as we only have cksum anchors in the manual to avoid
creating anchors for all of the legacy digest utilities.
Adjust all utils to:
- Have a separate translation per option
- Use either oputs() or oprintf(), instead of fputs() or printf().
- Use more standard alignment as discussed in previous commits.
- Various tweaks to descriptions.
* src/ls.c (usage): This is less constrained when writing comments,
and more consistent in output alignment. There is less delineation
between options and descripts, but given options are highlighted
by default now, this is a more appropriate format to use.
Note consistently showing description on the line following the option,
avoids any issue with the user needing to visually line up
the option with a description far to the right.
Note this format more closely aligns with that used in man pages.
* man/help2man: Make the (--?) part of the match optional.
Note we still extract the dashes, to support the existing
option matching logic in help2man.
* man/help2man: The BEL terminator format was already supported.
Add support for ESC + backslash terminator. Also split out
and document the regular expression.
* man/help2man: Convert OSC hyperlinks to roff \X escapes,
which will be converted back to OSC hyperlinks when
the man page is displayed on the terminal.
Note formatting is removed from hyperlinked text by default,
thus relying on how the terminal highlights hyperlinks,
but --bold-refs is honored in this case, in which hyperlinked
text will be marked up as bold, which matches the default
markup used for non hyperlinked options.
* man/help2man: Allow for a smaller indented option description.
This smaller indentation is present in timeout --help output,
so now the line spacing in timeout.1 is more consistent.
Also having the description on a separate line with
a smaller indentation, is a more general way to present
option descriptions (and what the man page formatting uses already).
We'll be changing many utilities, especially with longer multi-line
descriptions to this new format.
* man/help2man: With these ANSI codes, output is corrupted,
so it's best to strip these, which allows --help to
outputting formatting and hyperlinks by default.
* src/system.h: Support "-p DIR, --tmpdir[=DIR]" option.
Previously only the "-p" was highlighted.
Support highlighting dd option syntax (no '-').
Support test(1) "FILE1 -nt FILE2" syntax.
* src/system.h (oputs_): Simplify processing if neither
MANUAL_URL or BOLD_MAN_REFS is defined. Also ensure
we only lookup the HELP_NO_MARKUP env var once per process.
* configure.ac: Adjust help text for --disable-bold-man-page-references,
and also define BOLD_MAN_REFS.
* src/ls.c (oputs): Output bold iff BOLD_MAN_REFS is defined.
* src/ls.c (oputs): A new function that wraps puts(),
but also highlights the --option-text portion, and
adds links to the appropriate part of the online manual.
(usage): Call oputs() rather than puts().
* doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var,
which can be used in the edge case one wants to suppress ansi escapes.
* tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the
test continues to pass.
Following commit v9.9-109-gcd5229222
* src/cksum.c (PROGRAM_NAME): In legacy mode, i.e., when built
as a single binary, set the PROGRAM_NAME dynamically based on
the selected digest type. This is significant in --help
to ensure the correct texinfo node is referenced, and in
--version to ensure the correct utility name is output.
* tests/misc/sync.sh: Check 'sync fifo' with no arguments, -d, and -f
separately. Only perform the check for -f if RUN_EXPENSIVE_TESTS=yes
since it may be expensive.
A simpler fix than commit v9.9-4-g3b6efd555
which is less dependent on the exact behavior
of a multi-call binary.
* tests/env/env.sh: Use a local script rather than 'true'.
which may be a symlinked multi-call binary.
https://github.com/coreutils/coreutils/pull/174
* .gitignore (/build-aux/makeinfo-wrapper.sh):
* Makefile.am (EXTRA_DIST): Remove build-aux/makeinfo-wrapper.sh.
* build-aux/makeinfo-wrapper.sh.in: New file, renamed from
build-aux/makeinfo-wrapper.sh and modified to use @MAKEINFO@ instead of
makeinfo.
* cfg.mk (MAKEINFO): Remove variable.
* configure.ac: Add build-aux/makeinfo-wrapper.sh as a configure file.
* doc/local.mk (MAKEINFO): Define to
$(abs_top_builddir)/build-aux/makeinfo-wrapper.sh.
(AM_MAKEINFOFLAGS): Move over some values from the previous MAKEINFO
definition.
* tests/misc/coreutils.sh: Be more flexibile by using `command -v`
to identify the binary to be executed, rather than linking
directly to the built binary.
* src/uptime.c (print_uptime): Add a timezone_t cast to zero. Don't use
nullptr since timezone_t is not a standardized and may be defined to
something other than a pointer.
* src/basenc.c (long_options):
* src/chcon.c (change_file_context):
* src/copy.c (is_ancestor):
* src/env.c (build_argv):
* src/expr.c (nomoreargs):
* src/factor.c (mp_no_factors):
* src/ls.c (long_options, main):
* src/selinux.c (defaultcon, restorecon_private):
* src/shred.c (dopass):
* src/shuf.c (long_opts):
* src/tac.c (output):
* src/test.c (term):
* src/uniq.c (check_file): Do not use ‘0’ as a null pointer
constant. Although it is typically valid C, there are exceptions
(e.g., stdarg) and it a bit cleaner to be consistent. This patch
uses NULL, not nullptr, as I have second thoughts about nullptr;
see <https://bugs.gnu.org/66221#53>.
Setup
$ ln -nsf src/coreutils foo
Before
$ ./foo; echo $?
foo: unknown program ‘foo’
Try './foo --help' for more information.
1
./foo --version; echo $?
coreutils (GNU coreutils) 9.9.172-01993
0
After
$ ./foo; echo $?
coreutils: unknown program 'foo'
1
$ ./foo --version; echo $?
coreutils: unknown program 'foo'
1
* src/coreutils.c (main): Don't process options if
we don't know they're intended for the multi-call binary.
Otherwise `foo --version` would return true, even though
foo was symlinked to the multi-call binary, but not supported.
* tests/misc/coreutils.sh: Add test cases.
* NEWS: Mention the change in behavior.
GCC 10.2 gave the following error:
"error: a label can only be part of a statement
and a declaration is not a statement"
* src/fold.c (fold_file): Add a ";" to avoid C2X specific syntax.