[Bug🐛] Two option long names contain spaces and cannot be typed by a user
@shubhambhar007 is already working on this.
Since Sep 19, 2026.
Assessment
This issue has not been assessed yet.
Description
Prerequisites
- I have searched existing issues and discussions
- This is a bug, not a question (use Discussions for questions)
Environment
- OS: any
- RocketMQ Rust: main branch, commit
776518531 - Rust: per workspace toolchain in
rust-toolchain.toml
Bug Description
Two clap arguments register a long option name that contains a space. A shell
splits --list format into two separate tokens, so clap never sees a single
long flag with that name and the option cannot be used in its long form.
// rocketmq-tools/rocketmq-admin/rocketmq-admin-cli/src/commands/topic/topic_route_sub_command.rs line 37
#[arg(short = 'l', long = "list format", required = false, help = "list format")]
list_format: Option<bool>,
// rocketmq-tools/rocketmq-admin/rocketmq-admin-cli/src/commands/consumer/consumer_status_sub_command.rs line 46
short = 'n',
long = "name server address",
required = false,
help = "input name server address"
These are the only two long names in the crate that contain a space. Every other
command names this argument namesrvAddr, for example
rocketmq-admin-cli/src/commands.rs line 84, so a user who types the
conventional --namesrvAddr gets a usage error. The long help text is also
misleading: "list format" repeats the flag name instead of describing it.
list_format is additionally typed Option<bool>, which requires a value, so
plain -l (the Apache RocketMQ Java admin spelling) is a usage error too.
Steps to Reproduce
cargo run -p rocketmq-admin-cli -- topic topicRoute -t TopicTest --list format
cargo run -p rocketmq-admin-cli -- consumer consumerStatus --name server address 127.0.0.1:9876
Both fail with a usage error, even though the flags are declared.
Expected vs Actual
Expected: the long form of each option can be passed on the command line,
and the help text describes what the option does.
Actual: --list format and --name server address are rejected as
unrecognized arguments, so only the short forms -l and -n are reachable.
Logs/Screenshots
$ rocketmq-admin-cli topic topicRoute -t TopicTest --list format
ERROR core.argument.invalid: Argument is invalid
$ echo $?
64
$ rocketmq-admin-cli consumer consumerStatus --name server address 127.0.0.1:9876
ERROR core.argument.invalid: Argument is invalid
$ echo $?
64
--help shows the broken long name and, for list_format, the value requirement:
$ rocketmq-admin-cli topic topicRoute --help
Options:
-n, --namesrvAddr <NAMESRV_ADDR>
Name server address list, eg: '192.168.0.1:9876;192.168.0.2:9876'
...
-l, --list format <LIST_FORMAT>
list format
[possible values: true, false]
Note that the same topicRoute command already spells its address flag
--namesrvAddr, so the consumer command is the one that deviates.
Additional Context
Pick the long names the rest of the crate already uses:
--namesrvAddr for the consumer command, and a single word such as
--listFormat (or --list-format) for the topic route command. Whichever you
pick, use the same spelling in the help text and in the flag itself.
Two decisions belong to the maintainers, so keep them out of this change unless
they are confirmed in the issue thread:
- whether
list_formatshould stayOption<bool>(a value is required) or
become a plainboolflag so that-lalone works; - whether the old spaced names must keep working as hidden aliases for backward
compatibility.
If the answer to either is "yes", say so in the pull request rather than
expanding the change.
Acceptance Criteria
- Neither file declares a
longvalue containing a space. - The
--namesrvAddrspelling on the consumer command matches the spelling
used elsewhere in the crate. - A new or extended test in the same file parses the long form successfully,
so the regression cannot come back. - Any alias kept for compatibility is covered by a test as well.
Validation
Run from the repository root:
cargo fmt -p rocketmq-admin-cli -- --check
cargo test -p rocketmq-admin-cli
cargo run -p rocketmq-admin-cli -- topic topicRoute --help
cargo run -p rocketmq-admin-cli -- consumer consumerStatus --help
The --help runs are the quickest way to confirm the long name is spelled the
way you intend, since clap prints the registered long form.
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 264
- Avg merge
- 1h 34m
- Merged PRs (30d)
- 567
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mxsm/rocketmq-rust
-
Difficulty level/Easy good first issue help wanted rocketmq-tools crate rust testing🧪
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
mxsm/rocketmq-rust#10783 ·
-
bug🐛 Difficulty level/Easy good first issue help wanted rocketmq-tools crate rust
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
mxsm/rocketmq-rust#10781 ·
-
Difficulty level/Easy enhancement✨ good first issue help wanted rocketmq-tui crate rust
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
mxsm/rocketmq-rust#10779 ·
-
Difficulty level/Easy documentation📝 good first issue help wanted rocketmq-tools crate rust
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
mxsm/rocketmq-rust#10774 ·
-
Difficulty level/Easy good first issue help wanted rocketmq-tools crate rust testing🧪
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
mxsm/rocketmq-rust#10773 ·
All issues in mxsm/rocketmq-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100