struct

Obsctl::CLI::FlagSpec

Inherits Struct < Value < Object

One global option, declared once.

The argv splitter has to know whether a flag consumes the following token before OptionParser ever sees it, because everything from the first positional onwards belongs to the subcommand and may contain flags this parser knows nothing about (--topics, --headless, --dry-run). Declaring the flags as data keeps the splitter and the parser from disagreeing about where the global section ends.

Constructors

new(long : String, value : String | Nil = nil, short : String | Nil = nil, description : String = "")
Source

Instance methods

clone
Source
copy_with(long _long = @long, value _value = @value, short _short = @short, description _description = @description)
Source
description
long
short
takes_value?

True when this flag takes a separate following token.

Source
to_flag

Renders the flag in the form OptionParser#on expects.

Source
value