One entry of a Drafter.Prompt.select/3 or Drafter.Prompt.multiselect/3 list.
label is what is shown and value is what the prompt returns. hint is extra
text shown dimmed after the label. A disabled choice is shown but cannot be
picked.
new/1 accepts the shorter spellings a prompt takes:
iex> Drafter.Prompt.Choice.new("Phoenix")
%Drafter.Prompt.Choice{label: "Phoenix", value: "Phoenix"}
iex> Drafter.Prompt.Choice.new(:library)
%Drafter.Prompt.Choice{label: "library", value: :library}
iex> Drafter.Prompt.Choice.new({"Phoenix app", :phoenix})
%Drafter.Prompt.Choice{label: "Phoenix app", value: :phoenix}
iex> Drafter.Prompt.Choice.new(label: "Escript", value: :escript, hint: "one file")
%Drafter.Prompt.Choice{label: "Escript", value: :escript, hint: "one file"}
Summary
Types
What new/1 accepts: a choice, a string, an atom or number, a {label, value}
pair, or a keyword list or map with :label and optionally :value, :hint and
:disabled. A missing :value is the label.
Types
What new/1 accepts: a choice, a string, an atom or number, a {label, value}
pair, or a keyword list or map with :label and optionally :value, :hint and
:disabled. A missing :value is the label.