-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
all: print format of invalid option #3333
Copy link
Copy link
Closed
Description
refer: #3320
Below is at least one of the reason why the gnu test tests/misc/usage_vs_getopt.sh is in error state.
gnu:
> b2sum -/
b2sum: invalid option -- '/'
Try 'b2sum --help' for more information.
uutils:
> ./target/release/b2sum -/
error: Found argument '-/' which wasn't expected, or isn't valid in this context
If you tried to supply `-/` as a value rather than a flag, use `-- -/`
USAGE:
b2sum [OPTIONS] [FILE]...
For more information try --help
Explanation:
- Note that whereas gnu prints
'/'in the error message, uutils prints'-/'. - The gnu test greps for
" '*/'*"in the output error message. - In grep, the
*indicates zero or more preceding character. The error message should have something like'/'and not'-/'. - I think the gnu test is wrong. I am assuming the intention of
*is meant to be any character not just the preceding character. It does not make sense to have error message that'll have multiple single quote like'''/'''. The person who wrote the test might not have know the behavior of*ingrep.
I am not sure if we need to fix the uutils error message to remove preceding - or fix the gnu test.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done