Merge pull request #1095 from mtopolnik/delete-dup
Delete duplicate code in core/main
This commit is contained in:
commit
82bb6a4c93
1 changed files with 0 additions and 37 deletions
|
@ -7,43 +7,6 @@
|
||||||
[clojure.string :as string]
|
[clojure.string :as string]
|
||||||
[bultitude.core :as b]))
|
[bultitude.core :as b]))
|
||||||
|
|
||||||
(def ^:dynamic *debug* (System/getenv "DEBUG"))
|
|
||||||
|
|
||||||
(defn debug
|
|
||||||
"Print if *debug* (from DEBUG environment variable) is truthy."
|
|
||||||
[& args]
|
|
||||||
(when *debug* (apply println args)))
|
|
||||||
|
|
||||||
(def ^:dynamic *info* true)
|
|
||||||
|
|
||||||
(defn info
|
|
||||||
"Print unless *info* has been rebound to false."
|
|
||||||
[& args]
|
|
||||||
(when *info* (apply println args)))
|
|
||||||
|
|
||||||
(def ^:dynamic *exit-process?*
|
|
||||||
"Bind to false to suppress process termination." true)
|
|
||||||
|
|
||||||
(defn exit
|
|
||||||
"Exit the process. Rebind *exit-process?* in order to suppress actual process
|
|
||||||
exits for tools which may want to continue operating. Never call
|
|
||||||
System/exit directly in Leiningen's own process."
|
|
||||||
([exit-code]
|
|
||||||
(if *exit-process?*
|
|
||||||
(do (shutdown-agents)
|
|
||||||
(System/exit exit-code))
|
|
||||||
(throw (ex-info "Suppressed exit" {:exit-code exit-code}))))
|
|
||||||
([] (exit 0)))
|
|
||||||
|
|
||||||
(defn abort
|
|
||||||
"Print msg to standard err and exit with a value of 1.
|
|
||||||
Will not directly exit under some circumstances; see *exit-process?*."
|
|
||||||
[& msg]
|
|
||||||
(binding [*out* *err*]
|
|
||||||
(when (seq msg)
|
|
||||||
(apply println msg))
|
|
||||||
(exit 1)))
|
|
||||||
|
|
||||||
(def aliases {"-h" "help", "-help" "help", "--help" "help", "-?" "help",
|
(def aliases {"-h" "help", "-help" "help", "--help" "help", "-?" "help",
|
||||||
"-v" "version", "-version" "version", "--version" "version",
|
"-v" "version", "-version" "version", "--version" "version",
|
||||||
"überjar" "uberjar",
|
"überjar" "uberjar",
|
||||||
|
|
Loading…
Reference in a new issue