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

Elek, Marton commented on HDDS-438:
-----------------------------------


{quote}
- System.err.println(error.getMessage().split("\n")[0]); 
+ System.err.println(error.getMessage());
{quote}

In some cases a stack trace was added to the message as a string (maybe by the 
rpc stack, not sure) That was the reason to print out only the first line. But 
it's not a big deal.

But maybe it's more elegant to add an additional 'usage' field to the 
MissingSubcommandException. In that case the error message and the usage string 
will be more separated and structured and we can keep the split to make the 
exception message more nice and in case of MissingSubcommandException we can 
cast and print out the usage.

> 'ozone oz' should print usage when command or sub-command is missing
> --------------------------------------------------------------------
>
>                 Key: HDDS-438
>                 URL: https://issues.apache.org/jira/browse/HDDS-438
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Arpit Agarwal
>            Assignee: Dinesh Chitlangia
>            Priority: Major
>              Labels: newbie
>         Attachments: HDDS-438.001.patch
>
>
> When invoked without the command or sub-command, _ozone oz_ prints the 
> following error:
> {code:java}
> $ ozone oz
> Please select a subcommand
> {code}
> and
> {code:java}
> $ ozone oz volume
> Please select a subcommand
> {code}
> For most familiar with Unix utilities it is obvious they should rerun the 
> command with _--help._ However we can just print the usage instead to avoid 
> guesswork



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to