From 91087df7bbab8bd122d5c0844d1210f5d4ac3198 Mon Sep 17 00:00:00 2001 From: KGOH Date: Tue, 8 Nov 2022 12:38:05 +0200 Subject: [PATCH] Fix cli -main execution Co-authored-by: @ghrpp --- src/ftr/zen_cli.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ftr/zen_cli.clj b/src/ftr/zen_cli.clj index f83b261..c924ea9 100644 --- a/src/ftr/zen_cli.clj +++ b/src/ftr/zen_cli.clj @@ -2,6 +2,7 @@ (:gen-class) (:require [zen.cli] [ftr.zen-package] + [clojure.pprint] [zen.core] [zen.store] [cli-matic.core])) @@ -31,7 +32,7 @@ (defn -main - [& args] + [& [cmd-name & args]] (let [og-read-ns zen.core/read-ns] (with-redefs [zen.core/read-ns (fn [ztx zen-ns] @@ -40,6 +41,7 @@ zen.core/validate (fn [ztx symbols data] (-> (ftr.zen-package/validate ztx symbols data) (select-keys [:errors :warnings :effects])))] - (if (seq args) - (cli-matic.core/run-cmd args cfg) - (zen.cli/repl cfg))))) + (if (some? cmd-name) + (clojure.pprint/pprint (zen.cli/cmd cfg cmd-name args)) + (zen.cli/repl cfg)) + (System/exit 0))))