You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/02/15 14:09:45 UTC
[GitHub] husterxsp opened a new issue #776: make mqadmin usage information
more friendly to user
husterxsp opened a new issue #776: make mqadmin usage information more friendly to user
URL: https://github.com/apache/rocketmq/issues/776
When I run `sh bin/mqadmin updateTopic -t topicA `, I’m confused because i get
```shell
usage: mqadmin updateTopic [-b <arg>] [-c <arg>] [-h] [-n <arg>] [-o <arg>] [-p <arg>] [-r <arg>] [-s <arg>] -t <arg> [-u <arg>] [-w <arg>]
```
The usage tell me that I just need to set `-t` option, but I don't know why it doesn't run successfully.
So I look the source code `UpdateTopicSubCommand.java`,and I find that one of `-b` and `-c` should be required.
So I think
https://github.com/apache/rocketmq/blob/46ac065446de5a53e8cc3f8a010b9fe6147e9d53/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicSubCommand.java#L45-L52
should be changed to
```java
// UpdateTopicSubCommand.java
OptionGroup optionGroup = new OptionGroup();
Option opt = new Option("b", "brokerAddr", true, "create topic to which broker");
optionGroup.addOption(opt);
opt = new Option("c", "clusterName", true, "create topic to which cluster");
optionGroup.addOption(opt);
optionGroup.setRequired(true);
options.addOptionGroup(optionGroup);
```
After change, the usage will be
```shell
usage: mqadmin updateTopic -b <arg> | -c <arg> [-h] [-n <arg>] [-o <arg>] [-p <arg>] [-r <arg>] [-s <arg>] -t <arg> [-u <arg>] [-w <arg>]
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services