struct

Kebab::Schema::Option

Inherits Struct < Value < Object

An option flag declared on a command.

Constructors

new(*, long : String, short : Char | Nil, description : String, value_names : Array(String), min_values : Int32, max_values : Int32 | Nil, value_choices : Array(String) = [] of String, repetition : Repetition = Repetition::None)
Source

Instance methods

description

The description used in help output.

Source
long

The long flag name without the leading --.

Source
max_values

The most values the option accepts per occurrence. Nil means unbounded.

Source
min_values

The fewest values the option accepts per occurrence. 0 for flags.

Source
repeatable?

true if the option can be given more than once (a Count or Collect).

Source
repetition

How the option accumulates across occurrences: None, Count, or Collect.

Source
short

The short flag character (if any).

Source
takes_value?

true if the option expects at least one value, false for flags.

Source
value_choices

The accepted values for an enum-typed option, in help order. Empty when the values aren't a fixed set kebab knows (any non-enum, or a custom converter).

Source
value_names

Placeholder names for the option's values, rendered as <name> in help. Empty for flags.

Source
variable?

true if the number of values can vary per occurrence.

Source

Nested types