coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

coreutils: Print usage to stderr.

Open fnordahl opened this issue 8 months ago • 1 comments

Scripts exist that may call one of the multi-binary entry points with argument 0 set to some other value than the name of the entry point.

One example is the Open vSwitch testsuite which makes use of /bin/true as an argument to the bash builtin exec to check whether it supports the '-a' argument [0].

In this situation coreutils will print usage on standard output, which makes unnecessary noise.

Printing usage on standard error, which is customary for other tools, allows the script to succeed.

0: https://github.com/openvswitch/ovs/blob/28064e9fa50d/tests/ovs-macros.at#L199

fnordahl avatar May 12 '25 04:05 fnordahl

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar May 12 '25 05:05 github-actions[bot]