Better usage message in help output#1906
Conversation
Improve the usage message to better indicate that the path is optional, but must come after a pattern.
src/cli.rs
Outdated
| after_long_help = "Bugs can be reported on GitHub: https://github.com/sharkdp/fd/issues", | ||
| max_term_width = 98, | ||
| args_override_self = true, | ||
| override_usage = "fd [OPTIONS] [pattern [path]...]", |
There was a problem hiding this comment.
My one concern here, is that if the command is fdfind instead, the help output will still say fd.
I'm not really sure how to get around that though.
There was a problem hiding this comment.
You could just grab std::env::args()[0]
There was a problem hiding this comment.
Hmm, I'm not sure if that would work in the macro, but could probably be done with the api
There was a problem hiding this comment.
ok 1ea3719 does that. But it has a different issue where if you invoke it with something like target/debug/fd it will use the full path instead of just fd. I'm not sure which is worse. I could maybe try and figure out just the basename, but that makes this more complicated.
There was a problem hiding this comment.
and that makes tests more complicated 😕
Improve the usage message to better indicate that the path is optional, but must come after a pattern.