@@ -91,7 +91,7 @@ Define Multiple Subcommands
9191
9292Commands with a single executable function should simply implement handle(), but if you would
9393like have multiple subcommands you can define any number of functions decorated with
94- :func: `~django_typer.command ` or :func: `~django_typer.Typer.command `:
94+ :func: `~django_typer.management. command ` or :func: `~django_typer.management .Typer.command `:
9595
9696.. tabs ::
9797
@@ -196,8 +196,8 @@ Lets look at the help output:
196196Define Groups of Commands
197197-------------------------
198198
199- Any depth of command tree can be defined. Use the :func: `~django_typer.group ` or
200- :meth: `~django_typer.Typer.add_typer ` decorator to define a group of subcommands:
199+ Any depth of command tree can be defined. Use the :func: `~django_typer.management. group ` or
200+ :meth: `~django_typer.management. Typer.add_typer ` decorator to define a group of subcommands:
201201
202202
203203.. tabs ::
@@ -225,8 +225,8 @@ Define an Initialization Callback
225225---------------------------------
226226
227227You can define an initializer function that takes arguments _ and options _ that will be invoked
228- before your handle() command or subcommands using the :func: `~django_typer.initialize ` decorator.
229- This is like defining a group at the command root and is an extension of the
228+ before your handle() command or subcommands using the :func: `~django_typer.management. initialize `
229+ decorator. This is like defining a group at the command root and is an extension of the
230230`typer callback mechanism <https://typer.tiangolo.com/tutorial/commands/callback/ >`_.
231231
232232
@@ -264,11 +264,11 @@ This is like defining a group at the command root and is an extension of the
264264 Call Commands from Code
265265-----------------------
266266
267- There are two options for invoking a :class: `~django_typer.TyperCommand ` from code without spawning
268- off a subprocess. The first is to use Django _'s builtin call_command _ function. This function will
269- work exactly as it does for normal BaseCommand _ derived commands. django-typer _ however adds
270- another mechanism that can be more efficient, especially if your options and arguments are already
271- of the correct type and require no parsing:
267+ There are two options for invoking a :class: `~django_typer.management. TyperCommand ` from code
268+ without spawning off a subprocess. The first is to use Django _'s builtin call_command _ function.
269+ This function will work exactly as it does for normal BaseCommand _ derived commands. django-typer _
270+ however adds another mechanism that can be more efficient, especially if your options and
271+ arguments are already of the correct type and require no parsing:
272272
273273Say we have this command, called ``mycommand ``:
274274
@@ -303,8 +303,8 @@ Say we have this command, called ``mycommand``:
303303 The rule of thumb is this:
304304
305305 - Use call_command _ if your options and arguments need parsing.
306- - Use :func: `~django_typer.get_command ` and invoke the command functions directly if your
307- options and arguments are already of the correct type.
306+ - Use :func: `~django_typer.management. get_command ` and invoke the command functions directly if
307+ your options and arguments are already of the correct type.
308308
309309If the second argument is a type, static type checking will assume the return value of get_command
310310to be of that type:
@@ -325,7 +325,7 @@ You may also fetch a subcommand function directly by passing its path:
325325
326326 .. tip ::
327327
328- Also refer to the :func: `~django_typer.get_command ` docs and :ref: `here <default_cmd >`
328+ Also refer to the :func: `~django_typer.management. get_command ` docs and :ref: `here <default_cmd >`
329329 and :ref: `here <multi_commands >` for the nuances of calling commands when handle() is and is
330330 not implemented.
331331
@@ -335,15 +335,15 @@ You may also fetch a subcommand function directly by passing its path:
335335Change Default Django Options
336336-----------------------------
337337
338- :class: `~django_typer.TyperCommand ` classes preserve all of the functionality of BaseCommand _ derivatives.
338+ :class: `~django_typer.management. TyperCommand ` classes preserve all of the functionality of BaseCommand _ derivatives.
339339This means that you can still use class members like `suppressed_base_arguments
340340<https://docs.djangoproject.com/en/5.0/howto/custom-management-commands/#django.core.management.BaseCommand.suppressed_base_arguments> `_
341341to suppress default options.
342342
343- By default :class: `~django_typer.TyperCommand ` suppresses ``--verbosity ``. You can add it back by
344- setting ``suppressed_base_arguments `` to an empty list. If you want to use verbosity you can
345- simply redefine it or use one of django-typer _'s :ref: `provided type hints <types >` for the default
346- BaseCommand _ options:
343+ By default :class: `~django_typer.management. TyperCommand ` suppresses ``--verbosity ``. You can add
344+ it back by setting ``suppressed_base_arguments `` to an empty list. If you want to use verbosity you
345+ can simply redefine it or use one of django-typer _'s :ref: `provided type hints <types >` for the
346+ default BaseCommand _ options:
347347
348348.. tabs ::
349349
@@ -366,9 +366,9 @@ Configure Typer_ Options
366366------------------------
367367
368368Typer _ apps can be configured using a number of parameters. These parameters are usually passed
369- to the :class: `~django_typer.Typer ` class constructor when the application is created.
369+ to the :class: `~django_typer.management. Typer ` class constructor when the application is created.
370370django-typer _ provides a way to pass these options upstream to Typer _ by supplying them as keyword
371- arguments to the :class: `~django_typer.TyperCommand ` class inheritance:
371+ arguments to the :class: `~django_typer.management. TyperCommand ` class inheritance:
372372
373373.. tabs ::
374374
@@ -398,9 +398,9 @@ arguments to the :class:`~django_typer.TyperCommand` class inheritance:
398398
399399 .. tip ::
400400
401- See :class: `~django_typer.TyperCommandMeta ` or :class: ` ~django_typer.Typer ` for a list of
402- available parameters. Also refer to the ` Typer docs < https://typer.tiangolo.com >`_ for more
403- details.
401+ See :class: `~django_typer.management. TyperCommandMeta ` or
402+ :class: ` ~django_typer.management.Typer ` for a list of available parameters. Also refer to the
403+ ` Typer docs < https://typer.tiangolo.com >`_ for more details.
404404
405405
406406Define Shell Tab Completions for Parameters
@@ -658,8 +658,8 @@ Document Commands w/Sphinx
658658sphinxcontrib-typer _ can be used to render your rich helps to Sphinx docs and is used extensively
659659in this documentation.
660660
661- For example, to document a :class: `~django_typer.TyperCommand ` with sphinxcontrib-typer, you would
662- do something like this:
661+ For example, to document a :class: `~django_typer.management. TyperCommand ` with sphinxcontrib-typer,
662+ you would do something like this:
663663
664664.. code-block :: rst
665665
@@ -698,17 +698,18 @@ There are no unbreakable rules about how you should print output from your comma
698698You could use loggers, normal print statements or the BaseCommand _ stdout and
699699stderr output wrappers. Django advises the use of ``self.stdout.write `` because the
700700stdout and stderr streams can be configured by calls to call_command _ or
701- :func: `~django_tyoer .get_command ` which allows you to easily grab output from your
701+ :func: `~django_typer.management .get_command ` which allows you to easily grab output from your
702702commands for testing. Using the command's configured stdout and stderr
703703output wrappers also means output will respect the ``--force-color `` and ``--no-color ``
704704parameters.
705705
706706Typer _ and click _ provide `echo and secho <https://typer.tiangolo.com/tutorial/printing/ >`_
707707functions that automatically handle byte to string conversions and offer simple styling
708- support. :class: `~django_typer.TyperCommand ` provides :meth: `~django_typer.TyperCommand.echo ` and
709- :meth: `~django_typer.TyperCommand.secho ` wrapper functions for the Typer _ echo/secho
710- functions. If you wish to use Typer _'s echo you should use these wrapper functions because
711- they honor the command's ``--force-color `` and ``--no-color `` flags and the configured stdout/stderr
708+ support. :class: `~django_typer.management.TyperCommand ` provides
709+ :meth: `~django_typer.management.TyperCommand.echo ` and
710+ :meth: `~django_typer.management.TyperCommand.secho ` wrapper functions for the Typer _ echo/secho
711+ functions. If you wish to use Typer _'s echo you should use these wrapper functions because they
712+ honor the command's ``--force-color `` and ``--no-color `` flags and the configured stdout/stderr
712713streams:
713714
714715.. tabs ::
0 commit comments