hardillb/TRADFRI2MQTT

retained argument?

mo8Zomo0 opened this issue · 1 comments

The readme states the option "-retained", without an argument.

Running the jar with --help shows there should be one:

java -jar /root/src/TRADFRI2MQTT/target/TRADFRI2MQTT-0.0.7-SNAPSHOT.jar

usage: TRADFRI2MQTT
-broker MQTT URL
-ip The IP address of the gateway
-psk The Secret on the base of the gateway
-retained Topics are retained

and just running it with out one throws an exception:

org.apache.commons.cli.MissingArgumentException: Missing argument for option: retained
at org.apache.commons.cli.DefaultParser.checkRequiredArgs(DefaultParser.java:211)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:125)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:76)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:60)
at uk.me.hardill.TRADFRI2MQTT.Main.main(Main.java:512)
Exception in thread "main" java.lang.NullPointerException
at uk.me.hardill.TRADFRI2MQTT.Main.main(Main.java:518)

If there should be an argument

  • what shall it be?
  • more graceful way to die if not present
  • update doc

if it shall not be one:

  • adjust the code

thanks!