Skip to content

Commit d5a29f9

Browse files
committedMay 18, 2025··
TCLI-106 document :missing in README
Signed-off-by: Sean Corfield <[email protected]>
1 parent b9c8804 commit d5a29f9

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
 

‎.gitignore

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
2-
3-
#Visual Studio artifacts
1+
.calva/mcp-server/port
2+
.calva/repl.calva-repl
3+
.rebel_readline_history
4+
.vs/
45
*.nupkg
56
*.suo
67
*.user
7-
.calva/repl.calva-repl
8-
.vs/
98
/.calva/output-window
109
/.clj-kondo/.cache
1110
/.cpcache
@@ -19,4 +18,3 @@
1918
bin/
2019
obj/
2120
target
22-
.rebel_readline_history

‎README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ For detailed documentation, please see the docstring of `parse-opts`.
145145
:update-fn inc]
146146
["-f" "--file NAME" "File names to read"
147147
:multi true ; use :update-fn to combine multiple instance of -f/--file
148-
:default []
148+
;; if no -f/--file options are given, return this error:
149+
:missing "At least one file name is required"
149150
;; with :multi true, the :update-fn is passed both the existing parsed
150-
;; value(s) and the new parsed value from each option
151-
:update-fn conj]
151+
;; value(s) and the new parsed value from each option; using fnil lets
152+
;; us avoid specifying a :default value
153+
:update-fn (fnil conj [])]
152154
["-t" nil "Timeout in seconds"
153155
;; Since there is no long option, we need to specify the name used for
154156
;; the argument to the option...
@@ -166,7 +168,9 @@ For detailed documentation, please see the docstring of `parse-opts`.
166168
;; for the argument that an option expects. It is only needed when the long
167169
;; form specification of the option is not given, only the short form. In
168170
;; addition, :id must be specified to provide the internal keyword name for
169-
;; the option. There is no way to specify that an option itself is mandatory.
171+
;; the option. If you want to indicate that an option itself is required,
172+
;; you can use the :missing key to provide a message that will be shown
173+
;; if the option is not present.
170174

171175
;; The :default values are applied first to options. Sometimes you might want
172176
;; to apply default values after parsing is complete, or specifically to

0 commit comments

Comments
 (0)
Please sign in to comment.