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 6 (in-package :cli/clap/proto) 8 (deferror clap-error (std-error) () (:auto t)) 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))) 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))) 18 (defgeneric push-cmd (cmd place)) 20 (defgeneric push-opt (opt place)) 22 (defgeneric pop-cmd (place)) 24 (defgeneric pop-opt (place)) 26 (defgeneric find-cmd (self name &optional active)) 28 (defgeneric find-opts (self name &key active recurse)) 30 (defgeneric active-cmds (self)) 32 (defgeneric active-opts (self &optional global)) 34 (defgeneric find-short-opts (self ch &key)) 36 (defgeneric call-opt (self arg)) 38 (defgeneric do-opt (self)) 40 (defgeneric call-cmd (self args opts)) 42 (defgeneric do-cmd (self) 43 (:documentation "Run the command SELF with args parsed at runtime.")) 45 (defgeneric print-help (self &optional stream) 46 (:documentation "Format cli SELF as a helpful string.")) 48 (defgeneric print-version (self &optional stream) 49 (:documentation "Print the version of SELF.")) 51 (defgeneric print-usage (self &optional stream) 52 (:documentation "Format cli SELF as a useful string.")) 54 (defgeneric handle-unknown-argument (self arg) 55 (:documentation "Handle an unknown argument.")) 57 (defgeneric handle-missing-argument (self arg) 58 (:documentation "Handle a missing argument.")) 60 (defgeneric handle-invalid-argument (self arg) 61 (:documentation "Handle an invalid argument.")) 63 (defgeneric cli-equal (a b))