From c26878c59e3306b8571f2aea53a4ddf113c232c7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 13 Feb 2021 21:16:24 +0100 Subject: Replace exit codes with constants from the `sysexits` system --- l/src/main.lisp | 3 ++- l/src/option.lisp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'l/src') 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) -- cgit v1.2.3