GitHub

API reference for flag.

Named command-line options (Effect's Flag): --name value, --name=value, -n value, boolean switches and their --no-name negations.

A Flag[A] parses an A. Declare flags as attributes of a Config class; reading the attribute on the parsed config gives the value, typed::

class Deploy(Config):
    force = Flag.boolean("force").with_alias("f").with_default(False)
    retries = Flag.integer("retries").optional()

def handler(config: Deploy): ...  # config.force: bool, config.retries: int | None

Classes