 (defn- usage
   "Construct usage message."
   [options-summary]
-  (->> ["A Cyanite data removal tool"
-        ""
-        "Usage: "
-        "  cyanite-remover [options] remove-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-empty-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-empty-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover help"
-        ""
-        "Options:"
-        options-summary]
-       (str/join \newline)))
+  (str/join
+   \newline
+   ["A Cyanite data removal tool"
+    ""
+    "Usage: "
+    "  cyanite-remover [options] remove-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-empty-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-empty-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover help"
+    ""
+    "Options:"
+    options-summary]))
 
 (defn- error-msg
   "Combine error messages."

(defn- exit
  "Print message and exit with status."
  [status msg]
  (if (= status 0)
    (println msg)
    (binding [*out* *err*]
      (println msg)))

  [command valid-options options]
  (doseq [option (keys options)]
    (when (and (not (contains? valid-options option))
               (not= option :raw-arguments))
      (exit 1 (error-msg
               [(format "Option \"--%s\" conflicts with the command \"%s\""
                        (name option) command)])))))
