Skip to content

Expose cli args parsing ? parse to data structure ? #9

Closed
@ieugen

Description

@ieugen

Hello,

I wanted to use the library for parsing cli args and get the data as a map instead of running it.
This can be used inside an inline bb task where the dispatch function does not work ?! (did not try).

bb.edn

fetch-config
  {:task (let [opts (cli/parse-opts *command-line-args* cli-spec)]
    ;; use opts to run a simple command
    )
)}

I am looking into using babashka.cli instead for this use case which is perfectly ok.
I created this issue to record the use case.
Even if it's not possible, it should be documented IMO.

Thanks,
Eugen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions