3.1 Full Source

For cut’n paste convenience, the complete source code is given below. For a slightly longer example, have a look at the demonstration program called simple in the distribution.

(in-package :cl-user)

;; This is the ASDF way, but use Quicklisp's ql:quickload if you prefer.
(require "asdf")
(asdf:load-system :net.didierverna.clon)
(use-package :net.didierverna.clon)

(defsynopsis (:postfix "FILES...")
  (text :contents "A very short program.")
  (group (:header "Immediate exit options:")
    (flag :short-name "h" :long-name "help"
          :description "Print this help and exit.")
    (flag :short-name "v" :long-name "version"
          :description "Print version number and exit.")))

(defun main ()
  "Entry point for our standalone application."
  (when (getopt :short-name "h")
  (do-cmdline-options (option name value source)
    (print (list option name value source)))

(dump "quickstart" main)