OpenSearch/distribution
William Brafford 2b549e7342
CLI tools: write errors to stderr instead of stdout (#45586)
Most of our CLI tools use the Terminal class, which previously did not provide methods for writing to standard output. When all output goes to standard out, there are two basic problems. First, errors and warnings are "swallowed" in pipelines, making it hard for a user to know when something's gone wrong. Second, errors and warnings are intermingled with legitimate output, making it difficult to pass the results of interactive scripts to other tools.

This commit adds a second set of print commands to Terminal for printing to standard error, with errorPrint corresponding to print and errorPrintln corresponding to println. This leaves it to developers to decide which output should go where. It also adjusts existing commands to send errors and warnings to stderr.

Usage is printed to standard output when it's correctly requested (e.g., bin/elasticsearch-keystore --help) but goes to standard error when a command is invoked incorrectly (e.g. bin/elasticsearch-keystore list-with-a-typo | sort).
2019-08-21 14:46:07 -04:00
..
archives convert EmptyDirTask.groovy to .java (#34672) 2019-06-13 12:21:23 +03:00
bwc Add input and outut tracking of built bwc versions (#45694) 2019-08-20 10:05:33 +03:00
docker Make git revision loading lazy (#45358) 2019-08-08 17:08:07 -07:00
licenses Add notice for bundled jdk (#40576) 2019-03-29 17:21:21 -04:00
packages Use bundled JDK in Sys V init (#45593) 2019-08-15 16:15:17 -04:00
src Fix types field in JSON Search Slow Logs (#44641) 2019-07-22 12:02:20 +02:00
tools CLI tools: write errors to stderr instead of stdout (#45586) 2019-08-21 14:46:07 -04:00
build.gradle Notify systemd when Elasticsearch is ready (#44673) 2019-07-24 14:04:36 +09:00