Inspired by python optparse module.
Example usage (SBCL)
#!/usr/bin/sbcl --script (load "/path/to/asdf-init.lisp") (asdf:operate 'asdf:load-op 'optparser) (optparser:argv-let (argz (concurrency ("c" "concurrency" :value t)) (verbose("v" "verbose"))) *posix-argv* (format t "Arguments: ~s~%Optional values:~% verbose: ~s~% concurrency: ~s~%" argz verbose concurrency)) ~% ./optparser-test.cl somepath1 --verbose somepath2 --concurrency 30 Arguments: ("/usr/bin/sbcl" "somepath1" "somepath2") Optional values: verbose: T concurrency: "30" ~% ./optparser-test.cl -vc 10 somepath Arguments: ("/usr/bin/sbcl" "somepath") Optional values: verbose: T concurrency: "10"
Note that *posix-argv* var is SBCL-specific