effect-io-ai

Package: @effect/cli
Module: Options

Options.choice

Constructs command-line Options that represent a choice between several inputs. The input will be mapped to it’s associated value during parsing.

Example

import * as Options from "@effect/cli/Options"

export const animal: Options.Options<"dog" | "cat"> = Options.choice(
  "animal",
  ["dog", "cat"]
)

Signature

declare const choice: <A extends string, C extends ReadonlyArray<A>>(name: string, choices: C) => Options<C[number]>

Source

Since v1.0.0