GitHub

API reference for Setting.

class Setting[A]

A global flag read in handlers as a service. Subclass it with the flag; yield from Region() reads the value::

class Region(Setting[str | None]):
    flag = Flag.string("region").optional()

Command.pipe(with_global_flags(Region)) makes the command (and its subcommands) accept --region and provides Region.

Attributes

AttributeTypeDescription
flagFlag[Any]