From bb25cc2c977e04b43620de26eab78a9a625da1d0 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 18 May 2023 09:51:15 -0700 Subject: [PATCH] Make mqtt user/passwd optional --- module.nix | 1 + src/tattler/cli.clj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module.nix b/module.nix index 7cb2795..c6608bc 100644 --- a/module.nix +++ b/module.nix @@ -55,6 +55,7 @@ in { "--mqtt-host=${cfg.mqtt.host}" "--mqtt-port=${toString cfg.mqtt.port}" "--notification-topic=${cfg.notification-topic}" + "--app-name=tattler" ] ++ (optional cfg.verbose "--verbose") ++ (optional (cfg.mqtt.user != null) "--mqtt-user=${cfg.mqtt.user}") ++ (optional (cfg.mqtt.password-file != null) diff --git a/src/tattler/cli.clj b/src/tattler/cli.clj index 3fd5622..95f0168 100644 --- a/src/tattler/cli.clj +++ b/src/tattler/cli.clj @@ -42,7 +42,7 @@ (update result :errors concat missing-errors))) (defn -main [& args] - (let [required-args #{:mqtt-host :mqtt-port :mqtt-user :mqtt-password-file :app-name :notification-topic} + (let [required-args #{:mqtt-host :mqtt-port :app-name :notification-topic} {:keys [options _ errors summary]} (parse-opts args required-args cli-opts)] (when (seq errors) (msg-quit 1 (usage summary errors))) (let [{:keys [mqtt-host mqtt-port mqtt-user mqtt-password-file app-name notification-topic]} options