Skip to content

Commit

Permalink
キャッチする例外の範囲を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
moratori committed Dec 18, 2021
1 parent 3db5eb5 commit b5ec6e3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/ui/batch.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,26 @@
(defun main (args)
(let ((subcommand (first args))
(subcommand-args (cdr args)))
(cond
((probe-file subcommand)
; execute default command for a file
(%perform-command :COMPLETE (list subcommand)))
((or (not (scan "[a-zA-Z]+" subcommand))
(> (length subcommand) 9))
(%stdout "malformed command: ~A~%" subcommand)
(help))
(t
(handler-case
(let* ((command-name
(intern (string-upcase subcommand)
(find-package "KEYWORD")))
(available-command
(handler-case
(cond
((probe-file subcommand)
; execute default command for a file
(%perform-command :COMPLETE (list subcommand)))
((or (not (scan "[a-zA-Z]+" subcommand))
(> (length subcommand) 9))
(%stdout "malformed command: ~A~%" subcommand)
(help))
(t
(let* ((command-name
(intern (string-upcase subcommand)
(find-package "KEYWORD")))
(available-command
(compute-applicable-methods
#'%perform-command
(list command-name subcommand-args))))
(if available-command
(%perform-command command-name subcommand-args)
(%stdout "unimplemented command: ~A~%" subcommand)))
(condition (con)
(%stdout "unhandled condition occurred: ~A~%quit~%" con)))))))
(if available-command
(%perform-command command-name subcommand-args)
(%stdout "unimplemented command: ~A~%" subcommand)))))
(condition (con)
(%stdout "unhandled condition occurred: ~A~%quit~%" con)))))

0 comments on commit b5ec6e3

Please sign in to comment.