                             configs)))))
       (hash-map))))
 
-(defn -main [& args]
+(defn- parseplz!
+  [command args command-spec]
   (let [{:keys [options arguments errors summary]}
         (parse-opts args (concat
-                          cli-options
+                          (:cli command-spec)
                           [["-h" "--help" "Print this help page"]])
                     :in-order true)]
     (cond
       (or
         (:help options)
-        (empty? arguments))
+        (and
+         (empty? arguments)
+         (:subcommands command-spec)))
       (exit 0
-            (str (usage summary)
-                 (if (:required-arguments cli-options)
+            (str (usage command summary)
+                 (if (:required-arguments command-spec)
                    (str
                      "\n\n"
                      (required-args-msg
-                       (:required-arguments cli-options))
+                       (:required-arguments command-spec))
                      "\n\n")
                    "\n\n")
-                 (command-list (keys subcommand-cli))
-                 "\n\n"))
+                 (if (:subcommands command-spec)
+                   (str
+                    (command-list (keys (:subcommands command-spec)))
+                    "\n\n")
+                   "")))
       errors
       (exit 1
             (string/join
              \newline
              [(error-msg errors)
               ""
-              (usage summary)
-              ""
-              (command-list (keys subcommand-cli))
-              ""])))
+              (usage command summary)
+              (if (:subcommands command-spec)
+                (string/join
+                 \newline
+                 [
+                 ""
+                 (command-list (keys (:subcommands command-spec)))
+                 ""])
+                "")])))
+    {:options options
+     :arguments arguments}))
+
+(defn -main [& args]
+  (let [{:keys [options arguments]}
+        (parseplz! "degasolv" args cli-spec)]
     (let [global-options options
           subcommand (first arguments)
+          subcommand-cli (:subcommands cli-spec)
           subcmd-cli (if (not (= subcommand "display-config"))
                        (get subcommand-cli subcommand)
                        ; this grabs all other options as part of display-config

  {"apt" {:genrepo apt-pkg/slurp-apt-repo
             :version-comparison "debian"}
   "degasolv" {:genrepo degasolv-pkg/slurp-degasolv-repo
               :version-comparison "maven"}})

(defn- generate-repo-index-cli!
  [options arguments]

               ""
               ""))

(defn usage [command-name options-summary & {:keys [sub-command]}]
  (let [display-command (if sub-command
                          sub-command
                          "<command>")]
    (->> [(str "Usage: "
               command-name
               " <options> "
               (when sub-command
                 (str
                  sub-command
                  " <"
                  sub-command
                  "-options>")))
          ""
          "Options are shown below. Default values are listed with the"
          "  descriptions. Options marked with `**` may be"
          "  used more than once."
          ""
