Skip to main content

ArgumentInfo

This class provides a comprehensive structure for defining command-line arguments, extending the base parameter information with specialized metadata. It supports a wide range of configurations including default values, environment variables, validation constraints for numbers and paths, and custom parsing logic. Additionally, it includes settings for help text generation and integration with rich formatting panels.

Constructor

Signature

def ArgumentInfo(
default: Any | None = None,
param_decls: Sequence[str]| None = None,
callback: Callable[..., Any]| None = None,
metavar: str | None = None,
expose_value: bool = True,
is_eager: bool = False,
envvar: str | list[str]| None = None,
shell_complete: Callable | None = None,
autocompletion: Callable[..., Any]| None = None,
default_factory: Callable[[], Any]| None = None,
parser: Callable[[str], Any]| None = None,
click_type: click.ParamType | None = None,
show_default: bool | str = True,
show_choices: bool = True,
show_envvar: bool = True,
help: str | None = None,
hidden: bool = False,
case_sensitive: bool = True,
min: int | float | None = None,
max: int | float | None = None,
clamp: bool = False,
formats: list[str]| None = None,
mode: str | None = None,
encoding: str | None = None,
errors: str | None = "strict",
lazy: bool | None = None,
atomic: bool = False,
exists: bool = False,
file_okay: bool = True,
dir_okay: bool = True,
writable: bool = False,
readable: bool = True,
resolve_path: bool = False,
allow_dash: bool = False,
path_type: None | type[str]| type[bytes] = None,
rich_help_panel: str | None = None
) - > null

Parameters

NameTypeDescription
default`AnyNone` = None
param_decls`Sequence[str]None` = None
callback`Callable[..., Any]None` = None
metavar`strNone` = None
expose_valuebool = TrueWhether to pass the value to the function.
is_eagerbool = FalseWhether to process this parameter before others.
envvar`strlist[str]
shell_complete`CallableNone` = None
autocompletion`Callable[..., Any]None` = None
default_factory`Callable[[], Any]None` = None
parser`Callable[[str], Any]None` = None
click_type`click.ParamTypeNone` = None
show_default`boolstr` = True
show_choicesbool = TrueWhether to show valid choices in help text.
show_envvarbool = TrueWhether to show the environment variable in help text.
help`strNone` = None
hiddenbool = FalseWhether to hide this argument from help output.
case_sensitivebool = TrueWhether choice matching is case sensitive.
min`intfloat
max`intfloat
clampbool = FalseWhether to clamp numeric values to the min/max range.
formats`list[str]None` = None
mode`strNone` = None
encoding`strNone` = None
errors`strNone` = "strict"
lazy`boolNone` = None
atomicbool = FalseWhether file writes should be atomic.
existsbool = FalseWhether the path must exist.
file_okaybool = TrueWhether a file is a valid path.
dir_okaybool = TrueWhether a directory is a valid path.
writablebool = FalseWhether the path must be writable.
readablebool = TrueWhether the path must be readable.
resolve_pathbool = FalseWhether to resolve the path to an absolute path.
allow_dashbool = FalseWhether to allow '-' for stdin/stdout.
path_type`Nonetype[str]
rich_help_panel`strNone` = None

Signature

def ArgumentInfo(
default: Any | None = None,
param_decls: Sequence[str]| None = None,
callback: Callable[..., Any]| None = None,
metavar: str | None = None,
expose_value: bool = True,
is_eager: bool = False,
envvar: str | list[str]| None = None,
shell_complete: Callable | None = None,
autocompletion: Callable[..., Any]| None = None,
default_factory: Callable[[], Any]| None = None,
parser: Callable[[str], Any]| None = None,
click_type: click.ParamType | None = None,
show_default: bool | str = True,
show_choices: bool = True,
show_envvar: bool = True,
help: str | None = None,
hidden: bool = False,
case_sensitive: bool = True,
min: int | float | None = None,
max: int | float | None = None,
clamp: bool = False,
formats: list[str]| None = None,
mode: str | None = None,
encoding: str | None = None,
errors: str | None = "strict",
lazy: bool | None = None,
atomic: bool = False,
exists: bool = False,
file_okay: bool = True,
dir_okay: bool = True,
writable: bool = False,
readable: bool = True,
resolve_path: bool = False,
allow_dash: bool = False,
path_type: None | type[str]| type[bytes] = None,
rich_help_panel: str | None = None
) - > null

Parameters

NameTypeDescription
default`AnyNone` = None
param_decls`Sequence[str]None` = None
callback`Callable[..., Any]None` = None
metavar`strNone` = None
expose_valuebool = TrueWhether the value should be passed to the command function or only used for side effects.
is_eagerbool = FalseWhether to process this parameter before others to handle high-priority flags like --version.
envvar`strlist[str]
shell_complete`CallableNone` = None
autocompletion`Callable[..., Any]None` = None
default_factory`Callable[[], Any]None` = None
parser`Callable[[str], Any]None` = None
click_type`click.ParamTypeNone` = None
show_default`boolstr` = True
show_choicesbool = TrueWhether to list all valid choices for the argument in the help text.
show_envvarbool = TrueWhether to display the associated environment variable in the help text.
help`strNone` = None
hiddenbool = FalseIf true, the argument will be functional but omitted from the help documentation.
case_sensitivebool = TrueDetermines if string choice validation should respect character casing.
min`intfloat
max`intfloat
clampbool = FalseIf true, values outside the min/max range will be set to the nearest boundary instead of raising an error.
formats`list[str]None` = None
mode`strNone` = None
encoding`strNone` = None
errors`strNone` = "strict"
lazy`boolNone` = None
atomicbool = FalseIf true, file writes are performed to a temporary file and moved to the destination upon success.
existsbool = FalseIf true, the provided path must already exist on the filesystem.
file_okaybool = TrueWhether the path is allowed to point to a file.
dir_okaybool = TrueWhether the path is allowed to point to a directory.
writablebool = FalseIf true, the path must have write permissions.
readablebool = TrueIf true, the path must have read permissions.
resolve_pathbool = FalseIf true, converts the input path to an absolute path and resolves symlinks.
allow_dashbool = FalseIf true, allows '-' to represent stdin or stdout.
path_type`Nonetype[str]
rich_help_panel`strNone` = None