◐ Shell
clean mode source ↗

coreutils: output expected error for unrecognized options by ChrisDryden · Pull Request #9869 · uutils/coreutils

The coreutils multicall binary doesn't use clap for argument parsing - it manually handles a few known options (--list, --version, --help) and treats everything else as a utility name.

When given an unrecognized option like --unknown or -/, it was outputting:

--unknown: function/utility not found

This was causing the usage_vs_getopt.sh GNU test to fail because it expects the standard error format:

coreutils: unrecognized option '--unknown'

This PR adds detection for option-like arguments (starting with -) and outputs the proper error message.