You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
truncate: exit status should be 1, not 2, on invalid arguments #2951
The GNU version of truncate returns exit status 1 when the arguments are invalid, but the uutils version of truncate returns exit status 2.
GNU truncate
$ truncate file
truncate: you must specify either ‘--size’ or ‘--reference’
Try 'truncate --help' for more information.
$ echo $?
1
uutils truncate
$ ./target/debug/truncate file
error: The following required arguments were not provided:
--reference <RFILE>
--size <SIZE>
USAGE:
./target/debug/truncate [OPTION]... [FILE]...
For more information try --help
$ echo $?
2
In order to get the first two test cases in the GNU test file tests/misc/truncate-parameters.sh to pass, the uutils version needs to return exit status 1 in this situation.
Activity
shoriminimoe commentedon Feb 1, 2022
I took a whack at a solution in #3012