OptionsBase

class OptionsBase

Mixin for subcommand option dataclasses.

Provides from_args so the CLI dispatcher can construct an options instance from a parsed argparse.Namespace without spelling each field name a third time. Field names on the subclass dataclass must match the attribute names argparse produces (argparse already normalises --foo-bar into args.foo_bar).

Children
Members defined in OptionsBase (1 member)

from_args

RW

Build an options instance by pulling each dataclass field off args.

Attributes