changeset 653: | 119532882cb1 |
parent: | 6e5006dfe7b8 |
child: | 65102f74d1ae |
author: | Richard Westhaver <ellis@rwest.io> |
date: | Sun, 15 Sep 2024 19:34:00 -0400 |
permissions: | -rw-r--r-- |
description: | added keyword-opts (experimental) |
419
0f0e5f9b5c55
add emacs/babel.org, finished clap refactor phase 1, test system fixes and more top-level packages
Richard Westhaver <ellis@rwest.io>
parents:
404
diff
changeset
|
1 | ;;; cli/clap/pkg.lisp --- Clap Package Definitions |
0f0e5f9b5c55
add emacs/babel.org, finished clap refactor phase 1, test system fixes and more top-level packages
Richard Westhaver <ellis@rwest.io>
parents:
404
diff
changeset
|
2 | |
0f0e5f9b5c55
add emacs/babel.org, finished clap refactor phase 1, test system fixes and more top-level packages
Richard Westhaver <ellis@rwest.io>
parents:
404
diff
changeset
|
3 | ;; |
0f0e5f9b5c55
add emacs/babel.org, finished clap refactor phase 1, test system fixes and more top-level packages
Richard Westhaver <ellis@rwest.io>
parents:
404
diff
changeset
|
4 | |
0f0e5f9b5c55
add emacs/babel.org, finished clap refactor phase 1, test system fixes and more top-level packages
Richard Westhaver <ellis@rwest.io>
parents:
404
diff
changeset
|
5 | ;;; Code: |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
6 | (defpackage :cli/clap/vars |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
7 | (:use :cl) |
560
b9c64be96888
make cli/clap more dynamic
Richard Westhaver <ellis@rwest.io>
parents:
532
diff
changeset
|
8 | (:export :*cli-group-separator* :*no-exit* :*default-cli-def* |
b9c64be96888
make cli/clap more dynamic
Richard Westhaver <ellis@rwest.io>
parents:
532
diff
changeset
|
9 | :*default-cli-class* :*cli-opt-kinds* :*cli* :*opts* |
561 | 10 | :*args* :*argc* :*arg* :*optc*)) |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
11 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
12 | (defpackage :cli/clap/util |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
13 | (:use :cl :std :log :sb-ext :cli/clap/vars) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
14 | (:export :args :arg0 :long-opt-p |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
15 | :short-opt-p :opt-group-p :opt-string-prefix-eq :cli-opt-kind-p |
643
f901de70a80e
opt fixes and test updates
Richard Westhaver <ellis@rwest.io>
parents:
625
diff
changeset
|
16 | :default-thunk |
653
119532882cb1
added keyword-opts (experimental)
Richard Westhaver <ellis@rwest.io>
parents:
649
diff
changeset
|
17 | :long-opt-has-eq-p |
119532882cb1
added keyword-opts (experimental)
Richard Westhaver <ellis@rwest.io>
parents:
649
diff
changeset
|
18 | :opt-keyword-p)) |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
19 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
20 | (defpackage :cli/clap/macs |
561 | 21 | (:use :cl :std :log :sb-ext :cli/clap/util :cli/clap/vars) |
567 | 22 | (:export :defopt :defcmd |
645 | 23 | :make-opt-parser :with-cli-handlers :make-shorty |
24 | :with-opt-restart-case)) |
|
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
25 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
26 | (defpackage :cli/clap/proto |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
27 | (:use :cl :std :log :sb-ext) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
28 | (:export :proc-args :clap-error :find-short-opts |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
29 | :find-cmd :find-opts :parse-args :print-help |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
30 | :print-usage :print-version :do-cmds :do-cmd |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
31 | :active-cmds :active-opts :call-opt :do-opt |
625 | 32 | :push-cmd :push-opt :cli-equal |
645 | 33 | :do-opts |
34 | :clap-simple-error |
|
35 | :clap-simple-warning |
|
36 | :clap-warning |
|
646
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
37 | :clap-unknown-argument |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
38 | :handle-unknown-opt |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
39 | :handle-missing-opt |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
40 | :handle-invalid-opt |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
41 | :handle-unknown-arg |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
42 | :handle-missing-arg |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
43 | :handle-invalid-arg |
95fd920af398
error handling methods for clap
Richard Westhaver <ellis@rwest.io>
parents:
645
diff
changeset
|
44 | :clap-missing-argument |
649 | 45 | :clap-invalid-argument |
46 | :activate-cmd |
|
47 | :activate-opt)) |
|
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
48 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
49 | (defpackage :cli/clap/ast |
560
b9c64be96888
make cli/clap more dynamic
Richard Westhaver <ellis@rwest.io>
parents:
532
diff
changeset
|
50 | (:use :cl :std :log :dat/sxp) |
b9c64be96888
make cli/clap more dynamic
Richard Westhaver <ellis@rwest.io>
parents:
532
diff
changeset
|
51 | (:export :cli-node :make-cli-node :cli-ast |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
52 | :make-cli-ast :cli-node-kind :cli-node-form)) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
53 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
54 | (defpackage :cli/clap/obj |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
55 | (:use :cl :std :log |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
56 | :sb-ext :cli/clap/proto :cli/clap/macs :cli/clap/util |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
57 | :cli/clap/vars :cli/clap/ast :cli/clap/util) |
560
b9c64be96888
make cli/clap more dynamic
Richard Westhaver <ellis@rwest.io>
parents:
532
diff
changeset
|
58 | (:import-from :dat/sxp :ast) |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
59 | (:export :make-cli :define-cli :defmain |
532
f6a340b92274
tests and fixes, added sbcl tools
Richard Westhaver <ellis@rwest.io>
parents:
491
diff
changeset
|
60 | :make-opts :make-cmds :parse-bool-opt :parse-string-opt |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
61 | :parse-form-opt :parse-list-op :parse-sym-op :parse-key-op |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
62 | :pasre-num-op :parse-file-op :parse-dir-op :cli |
439
ea4f008ad13f
packy work, added json-trailing-whitespace-p variable for json readers
Richard Westhaver <ellis@rwest.io>
parents:
426
diff
changeset
|
63 | :cli-cd :with-cli :opts :cmds :debug-opts |
649 | 64 | :cli-opt :cli-cmd :cli-opt-val :cli-opt-lock :cli-opt-name |
653
119532882cb1
added keyword-opts (experimental)
Richard Westhaver <ellis@rwest.io>
parents:
649
diff
changeset
|
65 | :active-cmds |
119532882cb1
added keyword-opts (experimental)
Richard Westhaver <ellis@rwest.io>
parents:
649
diff
changeset
|
66 | :%compose-keyword-opt)) |
426
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
67 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
68 | (defpackage :cli/clap/simple |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
69 | (:use :cl :std :log :sb-ext) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
70 | (:import-from :cli/ansi :.ris) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
71 | (:import-from :uiop :println) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
72 | (:import-from :sb-ext :parse-native-namestring) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
73 | (:shadowing-import-from :sb-ext :exit) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
74 | (:export)) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
75 | |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
76 | (pkg:defpkg :cli/clap |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
77 | (:nicknames :clap) |
3e721a3349a0
completed phase2 of clap migration
Richard Westhaver <ellis@rwest.io>
parents:
419
diff
changeset
|
78 | (:use-reexport :cli/clap/obj :cli/clap/vars :cli/clap/proto |
623 | 79 | :cli/clap/simple :cli/clap/util :cli/clap/macs :cli/clap/ast |
80 | :cli/clap/vars)) |