Coverage report: /home/ellis/comp/core/lib/cli/clap/proto.lisp

KindCoveredAll%
expression757 12.3
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; cli/clap/proto.lisp --- Clap Protocol
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :cli/clap/proto)
7
 
8
 (define-condition clap-condition () ())
9
 (eval-always
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)))
18
 
19
 (defun clap-unknown-argument (arg kind)
20
   (error 'clap-unknown-argument :name arg :kind kind))
21
 
22
 (defun clap-missing-argument (arg kind)
23
   (error 'clap-missing-argument :item arg :kind kind))
24
 
25
 (defun clap-invalid-argument (arg &key reason kind)
26
   (error 'clap-invalid-argument :name arg :kind kind :reason reason))
27
 
28
 (defgeneric cmds (self))
29
 (defgeneric opts (self))
30
 
31
 (defgeneric cli-args (self)
32
   (:method ((self null)) (args)))
33
 
34
 (defgeneric push-cmd (cmd place))
35
 
36
 (defgeneric push-opt (opt place))
37
 
38
 (defgeneric pop-cmd (place))
39
 
40
 (defgeneric pop-opt (place))
41
 
42
 (defgeneric find-cmd (name self &key active))
43
 
44
 (defgeneric (setf find-cmd) (new name self))
45
 
46
 (defgeneric find-opt (name self &key active default))
47
 
48
 (defgeneric (setf find-opt) (new name self))
49
 
50
 (defgeneric find-opts (name self &key active recurse))
51
 
52
 (defgeneric active-cmds (self))
53
 
54
 (defgeneric active-opts (self))
55
 
56
 (defgeneric activate-opt (self))
57
 
58
 (defgeneric activate-cmd (self))
59
 
60
 (defgeneric call-opt (self arg))
61
 
62
 (defgeneric do-opt (self))
63
 
64
 (defgeneric do-opts (self))
65
 
66
 (defgeneric call-cmd (self args opts))
67
 
68
 (defgeneric do-cmd (self)
69
   (:documentation "Run the command SELF with args parsed at runtime."))
70
 
71
 (defgeneric print-help (self &optional stream)
72
   (:documentation "Format cli SELF as a helpful string."))
73
 
74
 (defgeneric print-version (self &optional stream)
75
   (:documentation "Print the version of SELF."))
76
 
77
 (defgeneric print-usage (self &optional stream)
78
   (:documentation "Format cli SELF as a useful string."))