 ;====================================================================================
 (defn -main [& args]
   (let [{:keys [options arguments errors summary]} (parse-opts args common-options)]
-    (cond (not= (count arguments) 1) (exit 1 (usage))
-          errors (exit 1 (error-msg errors)))
+    (cond
+      (:version options) (exit 0 server-name)
+      (not= (count arguments) 1) (exit 1 (usage))
+      errors (exit 1 (error-msg errors)))
     (reset! web/allow-script-executing (:allow-scripts-executing options))
     (case (first arguments)
       "server" (start-server options summary)

            [clojure.java.io :as io])
  (:gen-class))


;====================================================================================
; Server Usage
;====================================================================================
(defn server-usage [options-summary]
  (->> ["AnyChart Export Server"
        ""
        "Action: server"
        "Usage: java -jar anychart-export.jar server [options]"

    ]

   ;Export PDF Args--------------------------------------------------------------------------------------------------
   ["-v" "--version" "Print version, can be used without action"]
   ["-h" "--help"]
   ])

(defn usage []
  (->> [server-name
        ""
        "Usage: java -jar anychart-export.jar action [options]"
        "Actions:"
