     (timbre/info "Program started")
     (timbre/info "Command line: " (string/join " " *command-line-args*)))
 
-
-(def exit-success 0)
-(def exit-failure-cli 2) ; Command line argument error
-
 (defn -main
   "Orchestrate the computation"
   [& args]
   (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
     (cond
-      (:help options) (exit exit-success (usage summary))
-      errors (exit exit-failure-cli (error-msg errors)))
+      (:help options)
+         (do (println (usage summary))
+               (System/exit exit-success))
+      errors (exit-with-error exit-failure-cli (error-msg errors)))
     (init-logging (:log options))
     (process-fasta-files (:minlen options) arguments)))


;; Set up logging infrastructure
(timbre/refer-timbre)

(def initial-stats
  "Initial value of stats, before any sequences have been considered"


  [minlen filename]
  (timbre/info "Processing FASTA file from" filename)
  (try
    (with-open [reader (bs/bs-reader (bs/init-fasta-file filename :iupacAminoAcids))]
      (process-fasta-reader minlen filename reader))
    (catch Exception e (exit-with-error exit-failure (.getMessage e)))))

(defn process-stdin
  "Compute the statistics for a single input FASTA file from stdin, 
