Compare commits

...

2 Commits

Author SHA1 Message Date
1ec2749319 Split cli app in two modules
Some checks failed
Compile and test using leiningen / Run tests (push) Has been cancelled
2026-01-14 18:42:38 +01:00
70190d3cc9 Split cli app in two modules 2026-01-14 18:42:18 +01:00
2 changed files with 18 additions and 13 deletions

View File

@@ -1,22 +1,13 @@
(ns riot.app (ns riot.app
#_{:clj-kondo/ignore [:refer-all]} #_{:clj-kondo/ignore [:refer-all]}
(:require [riot.core :refer :all] (:require [riot.commands :refer :all]
[riot.data :refer :all] [lambdaisland.cli :as cli])
[lambdaisland.cli :as cli]
[clojure.pprint :as pp]
[clojure.string :as s])
(:gen-class)) (:gen-class))
(defn test-fn
[opts]
(println "Options:")
(pp/pprint opts)
(println "Positional args:" (s/join "," (:lambdaisland.cli/argv opts))))
(defn -main [& args] (defn -main [& args]
(cli/dispatch (cli/dispatch
{:name "cli-test" {:name "cmd-test"
:command #'test-fn ; The function to call :command #'cmd-test ; The function to call
:flags ["-v, --verbose" "Increases verbosity" :flags ["-v, --verbose" "Increases verbosity"
"--input FILE" "Specify the input file"]} "--input FILE" "Specify the input file"]}
args)) args))

View File

@@ -0,0 +1,14 @@
(ns riot.commands
#_{:clj-kondo/ignore [:refer-all]}
(:require [riot.core :refer :all]
[riot.data :refer :all]
[clojure.pprint :as pp]
[clojure.string :as s])
(:gen-class))
(defn cmd-test
[params]
(println "Options:")
(pp/pprint opts)
(println "Positional args:" (s/join "," (:lambdaisland.cli/argv opts))))