Replies: 2 comments 1 reply
-
I think this behavior on clap's side is intended.
I guess? What do you suggest? If there's some clap flag to automatically convert them to stdout, sure let's add it. If it requires manual code for each command, I'm not sure it's worth the trouble?
Idk about this, but again, if there's a way to do it fully automatically and easily then sure, otherwise not worth the trouble. |
Beta Was this translation helpful? Give feedback.
-
I managed to make it work but it's pretty ugly, clap doesn't support custom subcommand parsers so it has to be part of the struct and handled after parsing, it's even worse with |
Beta Was this translation helpful? Give feedback.
-
Currently, all of the following command output their respective help message to stdout:
niri help
niri --help
niri msg help
niri msg --help
niri msg action help
niri msg action --help
While the following output to stderr:
niri msg
niri msg action
This is the default clap behavior, e.g.
cargo report
does the same thing.I think this is intended on clap's side to make turning subcommands optional forward compatible..? But I might be overthinking it, it could just be a bug.
Either way I don't think this behavior makes sense for niri,
niri msg
andniri msg action
will never be standalone commands, and this makes it annoying to grep them.Something that's more of a feature request but related: Should
--json
apply to help commands? I think it can useful to e.g. make a hotkey that pipes all actions into a launcher. For--help
and implicit help it doesn't make sense, but forhelp
explicitly I think it does:System Information
Beta Was this translation helpful? Give feedback.
All reactions