changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/cli/clap/proto.lisp

changeset 479: ff3b057402d1
parent: 3e721a3349a0
child: e49442cd6010
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 25 Jun 2024 22:28:30 -0400
permissions: -rw-r--r--
description: light cleanup
1 ;;; cli/clap/proto.lisp --- Clap Protocol
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :cli/clap/proto)
7 
8 (deferror clap-error (std-error) () (:auto t))
9 
10 ;; (defun treat-as-argument (condition)
11 ;; "A handler which can be used to invoke the `treat-as-argument' restart"
12 ;; (invoke-restart (find-restart 'treat-as-argument condition)))
13 
14 ;; (defun discard-argument (condition)
15 ;; "A handler which can be used to invoke the `discard-argument' restart"
16 ;; (invoke-restart (find-restart 'discard-argument condition)))
17 
18 (defgeneric push-cmd (cmd place))
19 
20 (defgeneric push-opt (opt place))
21 
22 (defgeneric pop-cmd (place))
23 
24 (defgeneric pop-opt (place))
25 
26 (defgeneric find-cmd (self name &optional active))
27 
28 (defgeneric find-opts (self name &key active recurse))
29 
30 (defgeneric active-cmds (self))
31 
32 (defgeneric active-opts (self &optional global))
33 
34 (defgeneric find-short-opts (self ch &key))
35 
36 (defgeneric call-opt (self arg))
37 
38 (defgeneric do-opt (self))
39 
40 (defgeneric call-cmd (self args opts))
41 
42 (defgeneric do-cmd (self)
43  (:documentation "Run the command SELF with args parsed at runtime."))
44 
45 (defgeneric print-help (self &optional stream)
46  (:documentation "Format cli SELF as a helpful string."))
47 
48 (defgeneric print-version (self &optional stream)
49  (:documentation "Print the version of SELF."))
50 
51 (defgeneric print-usage (self &optional stream)
52  (:documentation "Format cli SELF as a useful string."))
53 
54 (defgeneric handle-unknown-argument (self arg)
55  (:documentation "Handle an unknown argument."))
56 
57 (defgeneric handle-missing-argument (self arg)
58  (:documentation "Handle a missing argument."))
59 
60 (defgeneric handle-invalid-argument (self arg)
61  (:documentation "Handle an invalid argument."))
62 
63 (defgeneric cli-equal (a b))