borkdude / quickblog

Light-weight static blog engine for Clojure and babashka
https://blog.michielborkent.nl/
MIT License
165 stars 28 forks source link

Fix bug where setting default for command-specific opt wasn't honoured #71

Closed jmglov closed 1 year ago

jmglov commented 1 year ago

For example, given a function with the following spec:

(defn process-file
  {:org.babashka/cli
   {:spec
    {:media-file
     {:desc "Media file to transribe"
      :ref "<file>"
      :require true}}}}
  [{:keys [media-file] :as opts}]
  media-file)

Calling cli/dispatch like so would result in process-file returning nil:

(cli/dispatch {:media-file "some-file.mp4"})

Please answer the following questions and leave the below in as part of your PR.

borkdude commented 1 year ago

Thanks dude!