Closed ZJaume closed 1 year ago
Error message should indeed go to stderr, but usage should not normally do so. It is important that -? / -h / --help
output goes to stdout.
So I guess the print_usage
should print to stderr only when errors occurr?
Yeah, which is pretty simple to accomplish - just pass in stdout or stderr.
I found that bash commands print to stderr when -?
but stdout with -h
, is this ok for you or do you prefer -?
also in stdout? I think -?
is an error and should go to stderr for the reasons I was pointing out at the beginning.
I have merged an altered version of your suggestion.
Thank you! I was indeed waiting for your response to push that modications.
Hi everyone, Prompsit fellow here!
The standard way of doing this in Unix is to use stderr. Otherwise, if the program is inside a pipe and fails due to wrong arguments for example, the help message gets scrambled with standard output and input. I also changed the
tmx_compiler.cc
because the method already has an output file, so I'm assuming messages have to go to stderr. But I don't know how that component works and what the printed information means.