Option Types¶
Common types for command line argument specification.
- django_typer.types.ForceColor¶
The type hint for the
--force-color
option.The
--force-color
option is included by default and behaves the same as onBaseCommand
use it to force colorization of the command. You can check the supplied value of--force-color
by checking the force_color attribute of the command instance.alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dd220>]
- django_typer.types.HideLocals¶
A toggle to turn off exception traceback local variable rendering in rich tracebacks.
alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dd070>]
- django_typer.types.NoColor¶
The type hint for the
--no-color
option.The
--no-color
option is included by default and behaves the same as onBaseCommand
use it to force disable colorization of the command. You can check the supplied value of--no-color
by checking the no_color attribute of the command instance.alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dd130>]
- django_typer.types.PythonPath¶
The type hint for the
--pythonpath
option.The
--pythonpath
option is included by default and behaves the same as onBaseCommand
use it to specify a directory to add to the Python sys path.alias of
Annotated
[Path
|None
, <typer.models.OptionInfo object at 0x72669a4dce30>]
- django_typer.types.Settings¶
The type hint for the
--settings
option.The
--settings
option is included by default and behaves the same as onBaseCommand
use it to specify or override the settings module to use.alias of
Annotated
[str
, <typer.models.OptionInfo object at 0x72669a4dcd70>]
- django_typer.types.ShowLocals¶
A toggle to turn on exception traceback local variable rendering in rich tracebacks.
alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dcfb0>]
- django_typer.types.SkipChecks¶
The type hint for the
--skip-checks
option.The
--skip-checks
option is included by default and behaves the same as onBaseCommand
use it to skip system checks.alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dd2e0>]
- django_typer.types.Traceback¶
The type hint for the
--traceback
option.The
--traceback
option is included by default and behaves the same as onBaseCommand
use it to allowCommandError
exceptions to propagate out of the command and produce a stack trace.alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a4dcef0>]
- django_typer.types.Verbosity¶
The type hint for the
--verbosity
option.TyperCommand
does not include the verbosity option by default, but it can be added to the command like so if needed.from django_typer.types import Verbosity def handle(self, verbosity: Verbosity = 1): ...
alias of
Annotated
[int
, <typer.models.OptionInfo object at 0x72669a4dcc80>]
- django_typer.types.Version¶
The type hint for the
--version
option.The
--version
option is included by default and behaves the same as onBaseCommand
.alias of
Annotated
[bool
, <typer.models.OptionInfo object at 0x72669a44b110>]
- django_typer.types.print_version(context, _, value)[source]¶
A callback to run the
get_version()
routine of the command when –version is specified.