diff --git a/src/os-utils.lisp b/src/os-utils.lisp index b8162b1..fec4e83 100644 --- a/src/os-utils.lisp +++ b/src/os-utils.lisp @@ -90,6 +90,12 @@ :output output :error error)) +(defun process-exit-code (process) + (sb-ext:process-exit-code process)) + +(defun process-exit-success-p (process) + (= (process-exit-code process) 0)) + (defun open-with-editor (file) (multiple-value-bind (exe args) (external-editor) diff --git a/src/package.lisp b/src/package.lisp index ac2e3d7..e3ede40 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -339,6 +339,9 @@ :getenv :default-temp-dir :pwd + :run-external-program + :process-exit-code + :process-exit-success-p :open-with-editor :exit-program :user-cache-dir diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index 6e43d3a..99a4c57 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -26,13 +26,15 @@ (progn (croatoan:end-screen) (tui:with-notify-errors - (os-utils::run-external-program +man-bin+ - (list +program-name+) - :search t - :wait t - :input t - :output t - :error t))) + (let ((process (os-utils:run-external-program +man-bin+ + (list +program-name+) + :search t + :wait t + :input t + :output t + :error t))) + (when (not (os-utils:process-exit-success-p process)) + (error (_ "Unable to load manual, contact your system administrator")))))) #-man-bin (notify (_ "No manpage binary found on this system") :as-error t))