Fork me on GitHub

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
nice 2
Cora (she/her)17:07:43

using babashka to execute babashka tests for blog posts

🎯 12
❤️ 4
Cora (she/her)17:07:15

just the one post so far, but when I get to things like creating projects and code that has explicit version dependencies this'll get a lot more interesting