Skip to content

Commit 44aa29a

Browse files
committed
cli: fix --help detection after parse-opts* swap
parse-opts* keeps option values as raw strings, so :help is "true" not true. The (= {:help true} opts) check broke. Replace with a shape check that doesn't depend on the value.
1 parent 0cf72d3 commit 44aa29a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/squint/internal/cli.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@
412412
(let [{:keys [cmd opts]} (peek-cli-args cli-args {:aliases {:h :help}})]
413413
(when (or (not (seq cli-args))
414414
(and (not (seq opts)) (= "help" cmd))
415-
(and (not cmd) (= {:help true} opts)))
415+
;; only --help/-h with no other opts and no cmd
416+
(and (not cmd) (:help opts) (= 1 (count opts))))
416417
(str "Squint v" (version) "
417418
418419
Usage: squint <subcommand> [options...]

0 commit comments

Comments
 (0)