aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--l/src/main.lisp21
-rw-r--r--l/src/option.lisp22
2 files changed, 22 insertions, 21 deletions
diff --git a/l/src/main.lisp b/l/src/main.lisp
index 61a48be..5dee032 100644
--- a/l/src/main.lisp
+++ b/l/src/main.lisp
@@ -9,27 +9,6 @@
(defconstant +timeout-seconds+ 5)
-(opts:define-opts
- (:name :socket-url
- :description "DevTools protocol WebSocket URL"
- :long "socket-url"
- :arg-parser #'identity
- :meta-var "SOCKET_URL")
- (:name :reload-current-tab
- :description "pass this to reload the active Chrome tab"
- :long "reload-current-tab")
- (:name :debug
- :description "print debug output"
- :long "debug")
- (:name :help
- :description "print this help menu"
- :short #\h
- :long "help")
- (:name :version
- :description "show the program version"
- :short #\V
- :long "version"))
-
(defun main ()
(handler-bind ((error #'(lambda (e)
(exit-with-error e sysexits:+unavailable+))))
diff --git a/l/src/option.lisp b/l/src/option.lisp
index 3c266ea..6f9129c 100644
--- a/l/src/option.lisp
+++ b/l/src/option.lisp
@@ -2,6 +2,28 @@
(in-package :extreload)
+;; Available command line options.
+(opts:define-opts
+ (:name :socket-url
+ :description "DevTools protocol WebSocket URL"
+ :long "socket-url"
+ :arg-parser #'identity
+ :meta-var "SOCKET_URL")
+ (:name :reload-current-tab
+ :description "pass this to reload the active Chrome tab"
+ :long "reload-current-tab")
+ (:name :debug
+ :description "print debug output"
+ :long "debug")
+ (:name :help
+ :description "print this help menu"
+ :short #\h
+ :long "help")
+ (:name :version
+ :description "show the program version"
+ :short #\V
+ :long "version"))
+
(defmacro when-option ((options option) &body body)
"When `option` is present in `options`, run `body`."
`(let ((value (getf ,options ,option)))