Skip to content

IllegalArgumentException when optional flags are ommitted and additional args are passed to bb.cli.exec/main #104

@felixdo

Description

@felixdo

parse-exec-opts throws an IllegalArgumentException in the following case:

(ns fs123.test (:require [babashka.cli :as cli] [babashka.cli.exec]))

(defn test
  {:org.babashka/cli
   {:spec
     {:flag {:coerce :boolean :default true} }
    :args->opts [:args2opts]}}
  [what] what)

(babashka.cli.exec/main "fs123.test" "test-me" "my-arg")

Originating discussion from slack.

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