Skip to content

Commit

Permalink
Correct README example regarding :error-fn (#88)
Browse files Browse the repository at this point in the history
The indentation of :error-fn seemes to be misaligned.
This commit corrects it.
  • Loading branch information
rynkowsg committed Mar 4, 2024
1 parent 01f7d1d commit 2d21513
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ Here is an example script to get you started!
:validate dir-exists?} ; tests if --dir exists
:flag {:coerce :boolean ; defines a boolean flag
:desc "I am just a flag"}}
:error-fn ; a function to handle errors
(fn [{:keys [spec type cause msg option] :as data}]
(if (= :org.babashka/cli type)
(case cause
:require
(println
(format "Missing required argument: %s\n" option))
:validate
(println
(format "%s does not exist!\n" msg)))))
:error-fn ; a function to handle errors
(fn [{:keys [spec type cause msg option] :as data}]
(if (= :org.babashka/cli type)
(case cause
:require
(println
(format "Missing required argument: %s\n" option))
:validate
(println
(format "%s does not exist!\n" msg)))))
})

(defn -main
Expand Down

0 comments on commit 2d21513

Please sign in to comment.