Closed WhittlesJr closed 5 years ago
Makes sense - but can you get me an example of how to reproduce the issue?
(cli-matic.core/parse-cmds ["--opt1" ":a" "test"]
{:global-opts [{:option "opt1"
:short "o"
:type :oops}]
:commands [{:command "test"}]})
You actually get:
-- Spec failed --------------------
Function arguments
(...
{:app ...,
:global-opts
[{:option ...,
:as ...,
:type :deadzebra,
^^^^^^^^^^
:default ...}],
:commands ...})
should be one of: :edn, :ednfile, :float, :float-0, :int, :int-0, :json, :jsonfile, :keyword, :slurp, :slurplines, :string, :yaml, :yamlfile, :yyyy-mm-dd
or
should satisfy
set?
That makes sense, but just to be on the safe side, we throw an error.
I am not making a release for this fix, but thanks for pointing it out. It will go in next release.
You get
if you fat finger your :type.
This line should probably throw instead of returning the keyword
:unknown
: https://github.com/l3nz/cli-matic/blob/7ebd45d3d436f800dab51784bdd937a141812d38/src/cli_matic/utils.cljc#L125