      :else
      (throw (Exception. (str "Non boolean argument to boolean flag: " argument))))))
 
+
 (defn define-boolean [name default help & args]
   (apply define boolean-parser name default
          (or help "a boolean value")

   [com.lemonodor.getopt :as getopt]))


(defprotocol FlagValuesProtocol
  (register-flag [this flag ns])
  (flag-map [this]))


(defrecord FlagValues [__flags __flags_by_ns]
  FlagValuesProtocol
  (register-flag [this flag ns]
    (let [flags-by-ns (:__flags_by_ns this)
          name-entries (if (:short-name flag)
                         {(:short-name flag) flag
                          (:name flag) flag}
                         {(:name flag) flag})]
      (->FlagValues (merge (:__flags this) name-entries)
                    (assoc flags-by-ns ns (conj (flags-by-ns ns) flag)))))
  (flag-map [this]
    (:__flags this)))



(defn define-flag [flagvalues flag ns]
  (swap! flagvalues register-flag flag ns))


(defn define [parser name default help serializer & args]
  (define-flag
