      :arguments   A vector of unprocessed arguments
      :summary     A string containing a minimal options summary
      :errors      A possible vector of error message strings generated during
-                  parsing; nil when no errors exist
-     }
+                  parsing; nil when no errors exist}
 
   A few function options may be specified to influence the behavior of
   parse-opts:

  [switches flag]
  (-> (for [^String s switches]
        (cond
         (and flag (flag? s))            [(replace s #"\[no-\]" "no-") (replace s #"\[no-\]" "")]
         (and flag (.startsWith s "--")) [(replace s #"--" "--no-") s]
         :default                        [s]))
      flatten))


(ns ^{:author "Gareth Jones, Sung Pae"}
  clojure.tools.cli
  (:require [clojure.pprint :as pp]
            [clojure.string :as s]))

(defn- tokenize-args
  "Reduce arguments sequence into [opt-type opt ?optarg?] vectors and a vector
