(in-package #:lispsearch)

;;;; Entry point. Builds via program-op (see lispsearch.asd :entry-point).

(defun main ()
  "Parse argv with clingon, dispatch to a subcommand, and exit. Top-level
conditions become `error: ...` on stderr with a non-zero exit code."
  (handler-case
      (clingon:run (top-command))
    (#+sbcl sb-sys:interactive-interrupt #-sbcl error ()
      (uiop:quit 130))
    (error (e)
      (format *error-output* "error: ~A~%" e)
      (uiop:quit 1))))
