coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

missing "Usage:" in true/false

Open sylvestre opened this issue 10 months ago • 3 comments

it should start with Usage:

Reported here: https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2137580

$ LANG=C cargo run -q --features unix false --help|head -1
Returns false, an unsuccessful exit status.

with GNU:

LANG=C /usr/bin/false --help|head -1
Usage: /usr/bin/false [ignored command line arguments]

same for true

sylvestre avatar Jan 17 '26 11:01 sylvestre

Hi, Should the help output order template be modified globally in src/uucore/src/lib/lib.rs or should this ordering be applied only to true and false using a custom template?

dhr412 avatar Jan 17 '26 14:01 dhr412

let's start with true & false first

sylvestre avatar Jan 17 '26 15:01 sylvestre

@sylvestre, now added

relunsec@relunsec:~/software/coreutils/target/debug/Test$ ../true --help
Returns true, a successful exit status.

Immediately returns with the exit status 0, except when invoked with one of the recognized
options. In those cases it will try to write the help or version text. Any IO error during this
operation causes the program to return 1 instead.

Usage: true

Options:
      --help     Print help information
      --version  Print version information
relunsec@relunsec:~/software/coreutils/target/debug/Test$ ../false --help
Returns false, an unsuccessful exit status.

Immediately returns with the exit status 1. When invoked with one of the recognized options it
will try to write the help or version text. Any IO error during this operation is diagnosed, yet
the program will also return 1.

Usage: false

Options:
      --help     Print help information
      --version  Print version information
relunsec@relunsec:~/software/coreutils/target/debug/Test$ 

looks like, close that

HackingRepo avatar Jun 29 '26 17:06 HackingRepo