-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
Problem
I'd like to use babashka.cli to parse a cli string where an option can be passed multiple times and likewise also having multiple positional arguments.
Example
(cli/parse-args ["--foo" "a,b" "--foo" "c" "arg1" "arg2"]
{:coerce {:foo []
:positionals []}
:args->opts (repeat :positionals)
:collect {:foo (fn [coll arg-value]
(into (or coll [])
(str/split arg-value #",")))}})
;; => {:opts {:foo ["a" "b" "c" "arg1" "arg2"]}}But I would expect
{:opts {:foo ["a" "b" "c"] :positionals ["arg1" "arg2"]}}It seems that the :collect feature is eating all of the remaining arguments:
(cli/parse-args ["--foo" "a" "arg1" "arg2"] ...)
;; => {:opts {:foo ["a" "arg1" "arg2"]}}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels