From 1f234bd9525be263ea89037096abf39d136da77a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 1 Feb 2021 23:47:30 +0100 Subject: main: Start command line option parsing Include the 'unix-opts' library described in http://lispcookbook.github.io/cl-cookbook/scripting.html#parsing-command-line-arguments for command line option parsing. Define the options I need. We want a `--socket-url` option, and a list of extension IDs as free arguments. Implement the `-V` version command line argument. Thanks to JJJ (https://stackoverflow.com/users/1337941/jjj) on Stack Overflow for describing how to get the version number of an ASDF system: https://stackoverflow.com/questions/11084339/getting-the-version-of-an-asdf-system/11088022#11088022 Add a new `options.lisp` file where we'll add the option parsing restart error handling functions required by 'unix-opts'. --- l/src/option.lisp | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 l/src/option.lisp (limited to 'l/src/option.lisp') diff --git a/l/src/option.lisp b/l/src/option.lisp new file mode 100644 index 0000000..d828230 --- /dev/null +++ b/l/src/option.lisp @@ -0,0 +1,6 @@ +(in-package :extreload) + +(defmacro when-option ((options option) &body body) + `(let ((value (getf ,options ,option))) + (when value + ,@body))) -- cgit v1.2.3