Skip to content

Commit c597792

Browse files
committed
Remove unnecessary code from defcommand macro
1 parent d4c6bc5 commit c597792

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/net/lewisship/cli_tools.clj

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,12 @@
170170
;; it can also be a map with key :options
171171
test-mode?# (impl/command-map? args#)
172172
command-spec# ~(select-keys parsed-interface parse-cli-keys)]
173+
;; introspection mode is used primarily by completions; it invokes the function with no arguments
174+
;; (but with the flag on) and the command-spec is returned, from which completions are generated.
173175
(if impl/*introspection-mode*
174176
command-spec#
175-
(let [~command-map-symbol (cond
176-
test-mode?#
177+
(let [~command-map-symbol (if test-mode?#
177178
{:options (first args#)}
178-
179-
impl/*introspection-mode*
180-
command-spec#
181-
182-
:else
183179
(impl/parse-cli ~command-name'
184180
~docstring
185181
args#

0 commit comments

Comments
 (0)