Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created August 14, 2012 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/a0d614879581cc06c481 to your computer and use it in GitHub Desktop.
Save kballenegger/a0d614879581cc06c481 to your computer and use it in GitHub Desktop.
(ns cb.core
(:use [clojure.tools.cli :as cli])
(:gen-class))
(defn -main [& args]
(println args)
(let [[parsed-args _ _] (cli/cli args ["-m" "--main" "Main namespace"])]
(cond (nil? (:main parsed-args)) (println "Nothing to do here...")
:else (do
(println "Executing namespace " (:main parsed-args) ".")
(use (quote [(:main parsed-args) :as the-ns]))
(the-ns/-main)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment