 
 
 (defn die-on-exit-or-error
+  "print stack trace and die, used as callback to register-future!"
   [a-future error]
   (when error
     (trace/print-stack-trace error))



(defn die
  [msg & {:keys [exit-code] :or {exit-code 1}}]
  (println "Error:" msg)
  (System/exit exit-code))


(defn setup-logging!
  []
  ;; (log-config/set-logger! "org.apache.pdfbox" :pattern "%c %d %p %m%n")
  (doseq [name ["org" "com" "fscrawler-tika-convert" ""]]



(defn parse-command-line-options
  "parse command line options with clojure.tools.cli
   returns a map of options"

  [args]
  (let [[options args banner]
        (cli/cli args
