I find it odd that help messages and usage information should be printed to stderr, when most commands print to stdout. This pull request would effectively change calls to yargs.showHelp() to yargs.showHelp('log') making help messages and usage information get printed to stdout, rather than stderr.
How to Test
Here is some Python code to verify that the help messages are printed to stdout instead of stderr:
from subprocess import run, PIPE
# Run `particle`
out = run(['npm', 'start'], stdout=PIPE, stderr=PIPE)
print(out.stdout.decode('utf-8'))
# Run `particle help`
out = run(['npm', 'start', 'help'], stdout=PIPE, stderr=PIPE)
print(out.stdout.decode('utf-8'))
# Run `particle help cloud`
out = run(['npm', 'start', 'help', 'cloud'], stdout=PIPE, stderr=PIPE)
print(out.stdout.decode('utf-8'))
Description
I find it odd that help messages and usage information should be printed to stderr, when most commands print to stdout. This pull request would effectively change calls to
yargs.showHelp()
toyargs.showHelp('log')
making help messages and usage information get printed to stdout, rather than stderr.How to Test
Here is some Python code to verify that the help messages are printed to stdout instead of stderr:
Related Issues / Discussions
https://community.particle.io/t/particle-cli-help-messages-printed-to-stderr/59499
Completeness