Skip to content

Instantly share code, notes, and snippets.

@mikeananev
Created July 17, 2021 18:28
Show Gist options
  • Save mikeananev/66f1865b66ece55a2034efe9c49aec43 to your computer and use it in GitHub Desktop.
Save mikeananev/66f1865b66ece55a2034efe9c49aec43 to your computer and use it in GitHub Desktop.
Tip from @borkdude: 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}}"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment