Coverage report: /home/ellis/comp/core/lib/cli/clap/proto.lisp
Kind | Covered | All | % |
expression | 7 | 57 | 12.3 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; cli/clap/proto.lisp --- Clap Protocol
6
(in-package :cli/clap/proto)
8
(define-condition clap-condition () ())
10
(deferror clap-error (clap-condition) ())
11
(defwarning clap-warning (clap-condition) ())
12
(deferror clap-simple-error (simple-error clap-error) () (:auto t))
13
(deferror clap-unknown-argument (clap-error unknown-argument) ())
14
(deferror clap-missing-argument (clap-error missing-argument)
15
((kind :initarg :kind :initform nil)))
16
(deferror clap-invalid-argument (clap-error invalid-argument) ())
17
(defwarning clap-simple-warning (simple-warning clap-warning) () (:auto t)))
19
(defun clap-unknown-argument (arg kind)
20
(error 'clap-unknown-argument :name arg :kind kind))
22
(defun clap-missing-argument (arg kind)
23
(error 'clap-missing-argument :item arg :kind kind))
25
(defun clap-invalid-argument (arg &key reason kind)
26
(error 'clap-invalid-argument :name arg :kind kind :reason reason))
28
(defgeneric cmds (self))
29
(defgeneric opts (self))
31
(defgeneric cli-args (self)
32
(:method ((self null)) (args)))
34
(defgeneric push-cmd (cmd place))
36
(defgeneric push-opt (opt place))
38
(defgeneric pop-cmd (place))
40
(defgeneric pop-opt (place))
42
(defgeneric find-cmd (name self &key active))
44
(defgeneric (setf find-cmd) (new name self))
46
(defgeneric find-opt (name self &key active default))
48
(defgeneric (setf find-opt) (new name self))
50
(defgeneric find-opts (name self &key active recurse))
52
(defgeneric active-cmds (self))
54
(defgeneric active-opts (self))
56
(defgeneric activate-opt (self))
58
(defgeneric activate-cmd (self))
60
(defgeneric call-opt (self arg))
62
(defgeneric do-opt (self))
64
(defgeneric do-opts (self))
66
(defgeneric call-cmd (self args opts))
68
(defgeneric do-cmd (self)
69
(:documentation "Run the command SELF with args parsed at runtime."))
71
(defgeneric print-help (self &optional stream)
72
(:documentation "Format cli SELF as a helpful string."))
74
(defgeneric print-version (self &optional stream)
75
(:documentation "Print the version of SELF."))
77
(defgeneric print-usage (self &optional stream)
78
(:documentation "Format cli SELF as a useful string."))