coreutils
coreutils copied to clipboard
echo: arguments should be printed when multiple long args are passed
GNU
$ /bin/echo --version --help
--version --help
coreutils
$ cargo run --features unix -- echo --version --help
echo 0.0.24
for the short commands, if you do in GNU
$ /bin/echo -n --version
--version%
in coreutils
$ cargo run --features unix -- echo -n --version
echo 0.0.24
PS: is the same behavior if you change --version to --help will just get help section instead of version
additionally switching the order produces a different result :p GNU
$ /bin/echo --version -n
--version -n
Isn't echo fun? 😄 Do you want to attempt a PR this?
Haha sure is!
Do you want to attempt a PR this?
I don't know, not too familiar with the code base. What I am thinking is ditching clap for echo and parse the args the manually which would bring it closer to GNU but would compromise the code quality. Though if i do that it might also fix #5840
I've been working on special-casing it in the new parser. I think it might be worth a shot to customize it completely, if only to make a test suite with all the cases that the new parser will need to handle. The clap parser still needs to exist to print the help and to generate the manpages and completion, but we can ignore it for the actual parsing.
@sylvestre @cakebaker what's your opinion?