Exit with status 1 if scalar-schema tool fails
In case of an error in scalar-schema CLI options, it should fail with
an exit status other than 0.
(let [{:keys [options summary errors]
{:keys [cassandra cosmos dynamo help]} :options}
(parse-opts args cli-options)]
- (if (or help errors)
- (do (when (not help)
- (println (str "ERROR: " errors)))
- (println summary))
- (do
+ (cond
+ help (println summary)
+ errors (do
+ (println (str "ERROR: " errors))
+ (println summary)
+ (System/exit 1))
+ :else (do
(when cassandra (cassandra-schema/operate-cassandra options))
(when cosmos (cosmos-schema/operate-cosmos options))
(when dynamo (dynamo-schema/operate-dynamo options))))))
