GitHub

Argument

API reference for Argument.

A positional argument of a command, as data: name, type, fallbacks and bounds.

Attributes

AttributeTypeDescription
namestr
descriptionstr | None
typeType
type_namestr

The generic type name ("integer"), as help shows it without a metavar.

metavarstr | None
requiredbool

Parsing fails when this entry is absent and no fallback on its own path supplies a value. A Config or prompt fallback does not clear it; a sibling alternative of or_else is not taken into account.

fallbackstuple[Fallback, ...]

The fallbacks on this entry's own path, in the order the parser tries them.

variadicVariadicBounds | None
annotationsContext[Any]

Functions

__init__

__init__(name, description, type, type_name, metavar, required, fallbacks, variadic, annotations) -> None
ParameterTypeDescription
namestr
descriptionstr | None
typeType
type_namestr
metavarstr | None
requiredbool
fallbackstuple[Fallback, ...]
variadicVariadicBounds | None
annotationsContext[Any]