Created
February 18, 2014 05:19
-
-
Save guns/9065033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Any type of error class, as CLJS uses js/Error | |
(defn e! [fmt & args] | |
(throw (AssertionError. (apply format fmt args)))) | |
… | |
;; Exception message takes precedence over :validation-msg | |
["-i" "--input-directory DIR" | |
:validate-fn #(cond (not (ok-path? %)) | |
(e! "Input directory path %s is malformed" (pr-str %)) | |
(let [f (File. %)] | |
(and (.exists f) (not (.isDirectory f)))) | |
(e! "Input directory %s is not a directory" (pr-str %)) | |
:else true)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment