Repository navigation
printf: take --help/--version as options only when alone - #16385
Conversation
|
GNU testsuite comparison: |
|
thanks for tackling this! |
| match args.get(1) { | ||
| // `--help` and `--version` are options only when they are the sole | ||
| // argument; otherwise they are the format. | ||
| Some(arg) if args.len() == 2 && (arg == "--help" || arg == "--version") => {} |
There was a problem hiding this comment.
clippy is red, i think it's match_same_arms (this arm and _ are both {})
maybe a single if that inserts the -- would be simpler?
There was a problem hiding this comment.
Changed it to a single if. The red clippy was actually needless_bool in install.rs from main at that time (fixed on main in 124e313); clippy 1.100 is clean on this branch.
24ede43 to
d62c9f6
Compare
Merging this PR will regress 1 benchmark1 warning, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
Thanks for your PR |
Closes #16384
--helpand--versionwere taken as options as long as they came first, soprintf --version xprinted the version. Like GNU, only treat them as options when they are the only argument; otherwise they are the format.