    ["-y" "--pdf-y PDF-Y" "Pdf Y"
     :parse-fn #(Integer/parseInt %)]
 
-   ["-O" "--pdf-landscape PDF-LANDSCAPE" "PDF Orientation"]
-
-   ;Export PDF Args--------------------------------------------------------------------------------------------------
-   ["-v" "--version" "Print version, can be used without action"]
-   ["-h" "--help" "Print help"]])
-
-
-(defn usage []
-  (->> [server-name
-        ""
-        "Usage: java -jar anychart-export.jar action [options]"
-        "Actions:"
-        "  server    Start a new instance of AnyChart Export Server."
-        "            Use --help arg with action for more info."
-        ""
-        "  cmd       Run Export Server once"
-        "            Use --help arg with action for more info."
-        ""
-        "Please, see http://docs.anychart.com for more info."
-        ]
-       (string/join \newline)))
+   ["-O" "--pdf-landscape PDF-LANDSCAPE" "PDF Orientation"]])
+
+(def cmd-summary (:summary (parse-opts nil cmd-options)))
+(def full-cmd-summary (:summary (parse-opts nil (concat common-options cmd-options))))
+
+(def all-options
+  (concat common-options server-options cmd-options))
 
 
 ;====================================================================================



;====================================================================================
; Server Usage
;====================================================================================
(defn server-usage [options-summary]
  (->> [server-name

        ]
       (string/join \newline)))


(defn exit [status msg]
  (println msg)
  (System/exit status))


(defn error-msg [errors]
  (str "The following errors occurred while parsing your command:\n\n"
       (string/join \newline errors)))


;====================================================================================
; Options
;====================================================================================
(def common-options
  [["-C" "--config PATH" "Path to config"
    :default nil]
   ["-e" "--engine BROWSER" "Headless browser: phantom, chrome or firefox"
    :parse-fn keyword
    :validate [(fn [engine] (some #(= engine %) [:phantom :chrome :firefox]))]]
   ["-v" "--version" "Print version, can be used without action"]
   ["-h" "--help" "Print help"]])

(def common-summary (:summary (parse-opts nil common-options)))


(def server-options
  [["-P" "--port PORT" "Port number for the server."
    :parse-fn #(Integer/parseInt %)
    :validate [#(< 0 % 0x10000) "Must be a number between 0 and 65536"]]

