glinscott / leela-chess

**MOVED TO https://github.com/LeelaChessZero/leela-chess ** A chess adaption of GCP's Leela Zero
http://lczero.org
GNU General Public License v3.0
760 stars 301 forks source link

lc0 --help doesn't work; uses stderr instead of stdout #712

Open Technologov opened 5 years ago

Technologov commented 5 years ago

Standard Linux command like this fails: ./lc0 --help | more

Namely: all help is displayed as one huge mega-page, completely unreadble by humans. The pipe more doesn't work, because it uses stdout, which is empty buffer.

But redirecting stderr to STDOUT works: ./lc0 --help 2>&1 |more

Please redirect all output to STDOUT, where it should belong.

mooskagh commented 5 years ago

There are different opinions on the internet, but majority indeed seems to be inclined towards help going to stdout.

Feel free to send a PR if you have time. All is needed is replace all cerr with cout in OptionsParser::ShowHelp(): https://github.com/LeelaChessZero/lc0/blob/407be4d0bd480cb1a56e8bd86dcc3d5d8d58c6e7/src/utils/optionsparser.cc#L241