   [errors]
   (str "The following errors occurred while parsing your command:\n\n"
        (string/join \newline errors)))
-
-(defn exit
-  "Print an error message to stderr and then exit the program
-  with a given exit status.
-
-  Arguments:
-    status: The exit status of the program (non-negative integer).
-    msg: Error message to display on stderr (string).
-
-  Result:
-    nil"
-  [status msg]
-  ;; for some reason printing to stderr is not working
-  ;; (binding [*out* *err*] println msg)
-  (println msg)
-  (System/exit status))
 
 (def cli-options
   "Define the command line options of the program."

    (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)))
    (init-logging (:log options))
    (process-fasta-files (:minlen options) arguments)))


  [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, 
