emqx / MQTTX

A Powerful and All-in-One MQTT 5.0 client toolbox for Desktop, CLI and WebSocket.
https://mqttx.app
Apache License 2.0
3.93k stars 450 forks source link

[Bug] MQTTX CLI won't recognize topic -t or --topic when used with -lo for loading connection options #1809

Open oising opened 1 week ago

oising commented 1 week ago

What did I do

image

What happened

Get an error.

Expected

mqttx should allow me to pick a topic? lol

Environment

as my other bugs, SL7, node 22, win11 on arm64.

More detail

More detail include log information or screenshot

Red-Asuka commented 1 week ago

@oising Thank you for your feedback. Based on the description, I guess you may have manually deleted the topic setting from the mqttx-cli-options.json configuration file. Currently, the logic is completely overridden by the configuration file over command line options, resulting in the system prompting that the topic does not exist. What you pointed out is indeed an issue that needs to be optimized. Ideally, the priority of command line parameters should be higher than the settings in the configuration file. We will fix this issue in the next version. As a temporary solution, you can add the topic setting back to the configuration file.