changelog shortlog graph tags branches changeset files revisions annotate raw help

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

changeset 567: 32995daa9a07
parent: 8b10eabe89dd
child: 571685ae64f1
author: Richard Westhaver <ellis@rwest.io>
date: Mon, 29 Jul 2024 20:55:09 -0400
permissions: -rw-r--r--
description: skel and cli updates
1 ;;; cli/clap/vars.lisp --- Clap Variables
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :cli/clap/vars)
7 
8 (declaim (simple-string *cli-group-separator*))
9 (defparameter *cli-group-separator*
10  "--"
11  "A marker specifying the end of a unique group of CLI args.")
12 
13 (defparameter *no-exit* nil
14  "Indicate whether the WITH-CLI-HANDLERS form should exit on completion.")
15 
16 (defvar *default-cli-def* 'defparameter)
17 
18 (defvar *default-cli-class* 'cli
19  "The name of the class of the top-level CLI object which will be
20 generated by the DEFINE-CLI macro.")
21 
22 (declaim ((vector symbol) *cli-opt-kinds*))
23 (defvar *cli-opt-kinds* ;; make sure to keep this in sync with the list of parsers above
24  (let ((kinds '(boolean string form list symbol keyword number file directory pathname)))
25  (make-array (length kinds) :element-type 'symbol :initial-contents kinds)))
26 
27 (defvar *cli* nil
28  "Most recently used CLI object.
29 This symbol is bound in the body of the WITH-CLI macro.")
30 
31 (defvar *args* nil
32  "Current command arguments.
33 Bound for the lifetime of a DEFCMD function.")
34 
35 (defvar *opts* nil
36  "Current command options.
37 Bound for the lifetime of a DEFCMD function.")
38 
39 (declaim (unsigned-byte *argc* *optc*))
40 (defvar *argc* 0
41  "Current count of command arguments.
42 This value may be updated throughout the lifetime of a function defined with
43 DEFCMD.")
44 
45 (defvar *optc* 0
46  "Current count of command options.
47 This value may be updated throughout the lifetime of a function defined with
48 DEFCMD.")
49 
50 (defvar *arg* nil
51  "Current option argument.
52 Bound for the lifetime of afunction defined with DEFCMD.")