-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pulsar-perf: improve error message for unrecognized options #18866
Comments
Thanks, this is a nice suggestion. Maybe the problem is the topics parameter doesn't need a name such as For example, if we use this command, the result is the tool will publish messages to the topic
If we use this command, the tool wants to publish messages to topics
I think if we want to resolve this problem, we need to require the topics parameter to provide a param name, but this will change the using habit. |
Yes, that nicely summarizes the issue. The issue is partly due to the fact that pulsar allows topic names which start with weird characters such as '-', and also JCommander is pretty limited in terms of validation on options vs. args. |
Search before asking
Motivation
If I accidentally type a bad option when running the pulsar-perf command, I get an unhelpful error message.
I would expect pulsar-perf to provide an error that points out the bad option.
Solution
pulsar-perf should be able to determine if the user typed an option that is not valid.
I would think this would be handled automatically by the CLI library (jcommander in this case), but it seems to be interpreting unrecognized options as names of topics. If the CLI library can't handle this case correctly, pulsar should either switch to a different library, or add some additional error checking to see if an invalid option has been entered.
Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: