dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option for `accepted_values` or `allowed_values` ?

praveenperera opened this issue · comments

What do you think about having an option to validate against and set number of options?

For example:

definition = [
  status: [
    type: :atom,
    allowed_values: [:waiting, :started, :finished],
    default: :waiting
  ],
]

this is already supported via :one_of, e.g.:

batch_mode: [type: {:one_of, [:flush, :bulk]}]]