[ 
https://issues.apache.org/jira/browse/HDFS-11516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15903543#comment-15903543
 ] 

Andrew Wang commented on HDFS-11516:
------------------------------------

Hi Kai, thanks for filing this issue,

One question, if we're printing to stderr and it's a fatal error, shouldn't it 
also return a non-zero return code? This relates to the AdminHelper change.

I also dug up this link which had some useful tidbits:

https://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout

Snippets:

* stderr is also the place where you print stuff like help docs when an invalid 
argument is passed to a command.
* When asking explicitly for help docs they should be printed to stdout.

Wonder if you've audited our CLI tools to respect this?

Relatedly, I don't think the new tests really much more coverage, it would be 
nice to test the error codes though.

> Admin command line should print message to stderr in failure case
> -----------------------------------------------------------------
>
>                 Key: HDFS-11516
>                 URL: https://issues.apache.org/jira/browse/HDFS-11516
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Kai Sasaki
>            Assignee: Kai Sasaki
>            Priority: Minor
>         Attachments: HDFS-11516.01.patch
>
>
> {{AdminHelper}} and {{CryptAdmin}} where prints message to stdout instead of 
> stderr. Since other failure cases prints to stderr, it is necessary to 
> consolidate that manner.
> e.g.
> {code}
>       if (args.size() != 1) {
>         System.err.println("You must give exactly one argument to -help.");
>         return 0;
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to