commandlineparser / commandline

The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
MIT License
4.53k stars 477 forks source link

Send only the actual error to Console.Error #184

Open ohadschn opened 6 years ago

ohadschn commented 6 years ago

Currently all generated help text is sent to stderr (Console.Error) when an error occurs: https://github.com/commandlineparser/commandline/blob/7aa501d534a657c388f94f66127b4f8dde64ac59/src/CommandLine/Parser.cs#L199

Wouldn't it make more sense to only send the actual error there, and send the rest of the help text (both before and after) to stdout (Console.Out)?

ericnewton76 commented 6 years ago

Certainly would. +1 vote on that.

rmunn commented 4 years ago

According to the GNU coding standards the --help option is supposed to print to stdout, not stderr, so it's already a bug that CommandLineParser is sending help output to stderr.