Skip to content

Commit

Permalink
fix: type error in cmd function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
hraban committed Aug 11, 2024
1 parent b139d60 commit e4f971e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/cmd.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ For in-depth help, pass --help to a subcommand.
(documentation <> 'function)
(format T "~A: ~A~&" name <>)))

(declaim (ftype (function ((or symbol string) list) function) cmd))
(declaim (ftype (function ((or symbol string) list) t) cmd))
(defun cmd (name args)
"Call the command with these args"
(if (member name '("help" "-h" "--help"))
(declare (optimize (debug 3)))
(if (member name '("help" "-h" "--help") :test #'equal)
(if args
(print-help (first args))
(format T "~A" (usage-str)))
(if (help-args-p args)
(print-help name)
(-> name
get-cmd
(or (no-such-cmd name))
(apply args)))))
get-cmd
(or (no-such-cmd name))
(apply args)))))

0 comments on commit e4f971e

Please sign in to comment.