Compare commits
2 Commits
1fbd7258fe
...
1ec2749319
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ec2749319 | |||
| 70190d3cc9 |
@@ -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))
|
||||||
|
|||||||
14
projects/cli/src/riot/commands.clj
Normal file
14
projects/cli/src/riot/commands.clj
Normal 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))))
|
||||||
Reference in New Issue
Block a user