diff options
| author | Teddy Wing | 2021-02-13 21:16:24 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2021-02-13 21:16:24 +0100 | 
| commit | c26878c59e3306b8571f2aea53a4ddf113c232c7 (patch) | |
| tree | a1521288a9327dd7fdc3a63e19c80d05d192986a /l/src | |
| parent | 597d0b953fca40c1035cee6263b12fa5223ebf51 (diff) | |
| download | extreload-c26878c59e3306b8571f2aea53a4ddf113c232c7.tar.bz2 | |
Replace exit codes with constants from the `sysexits` system
Diffstat (limited to 'l/src')
| -rw-r--r-- | l/src/main.lisp | 3 | ||||
| -rw-r--r-- | l/src/option.lisp | 10 | 
2 files changed, 7 insertions, 6 deletions
| diff --git a/l/src/main.lisp b/l/src/main.lisp index 770d88b..3fc8953 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -25,7 +25,8 @@           :long "version"))  (defun main () -  (handler-bind ((error #'(lambda (e) (exit-with-error e 69)))) +  (handler-bind ((error #'(lambda (e) +                            (exit-with-error e sysexits:+unavailable+))))      (let ((config (parse-options)))        ;; Store the WebSocket client as a global. diff --git a/l/src/option.lisp b/l/src/option.lisp index b666fa4..02c89c2 100644 --- a/l/src/option.lisp +++ b/l/src/option.lisp @@ -11,7 +11,7 @@    (opts:exit exit-code))  (defun handle-option-error (condition) -  (exit-with-error condition 64)) +  (exit-with-error condition sysexits:+usage+))  (defun parse-options ()    (multiple-value-bind (options free-args) @@ -28,23 +28,23 @@          :usage-of "extreload"          :args "EXTENSION_ID...") -      (opts:exit 64)) +      (opts:exit sysexits:+usage+))      (when-option (options :version)        (format t "~a~%" (asdf:component-version (asdf:find-system :extreload))) -      (opts:exit 0)) +      (opts:exit sysexits:+ok+))      (when (null (getf options :socket-url))          (format *error-output* "error: '--socket-url' is required~%") -        (opts:exit 64)) +        (opts:exit sysexits:+usage+))      ;; Error if no extension IDs were given.      (when (null free-args)        (format *error-output* "error: missing extension IDs~%") -      (opts:exit 64)) +      (opts:exit sysexits:+usage+))      (make-config :socket-url (getf options :socket-url)                   :reload-current-tab (getf options :reload-current-tab) | 
