Commandline argument parser for Common Lisp
(in-package :cl-user)
(defpackage foo.bar
(:use :cl :corne))
(in-package :foo.bar)
(defvar *cli*
(cmd "hello"
:help "corne example command"
:version "1.0"
:options (list (opt "verbose" :short "v" :long "verbose" :help ""))
:arguments (list (arg "msg" :help "message"))))
(defun main (&rest argv)
(let* ((res (parse *cli* argv)))
(format t "hello ~A~%" (get-arg res "msg"))))
More examples are here.
$ ./example/hello.ros -h
hello 1.0
corne example command
USAGE: hello [OPTIONS] <MSG>
OPTIONS:
-v, --verbose
-h, --help Prints help information
ARGUMENTS:
<MSG> message
(defvar *cli*
(cmd "subcommand"
:help "corne example command"
:version "1.0"
:subcommands (list (cmd "foo" :help "foooo")
(cmd "bar" :help "baaar"
:subcommands (list (cmd "baz" :help "baaaz"))))))
- Corne is not registered Quicklisp yet.
- clone to your local-projects
# ex
git clone https://github.com/liquidz/corne ~/.roswell/local-projects
- register local project
(ql:register-local-projects)