This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-17
Channels
- # announcements (2)
- # babashka (1)
- # beginners (54)
- # calva (19)
- # clj-kondo (7)
- # cljs-dev (6)
- # cljsrn (18)
- # clojure (11)
- # clojure-europe (19)
- # clojurescript (7)
- # conjure (3)
- # cursive (7)
- # datomic (4)
- # figwheel-main (2)
- # fulcro (4)
- # helix (5)
- # honeysql (24)
- # instaparse (2)
- # lsp (20)
- # malli (17)
- # off-topic (6)
- # pathom (2)
- # practicalli (2)
- # shadow-cljs (2)
- # tools-deps (34)
- # vim (7)
Fun way to get arg parsing without much boilerplate:
#!/usr/bin/env bb
(require '[selmer.parser :refer [<<]])
(let [[& {:strs [-a -b --long-opt]}] *command-line-args*]
(<< "Command line opts: a: {{-a}}, b: {{-b}}, long-opt: {{--long-opt}}"))
$ ./cli.clj -a 1 -b 2 --long-opt 3
"Command line opts: a: 1, b: 2, long-opt: 3"
😃 26
2