Code

Ticket #18187: 18187-1.diff

File 18187-1.diff, 749 bytes (added by claudep, 2 years ago)

Added paragraph about command options

Line 
1diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
2index 74b67b2..ab3c0d4 100644
3--- a/docs/howto/custom-management-commands.txt
4+++ b/docs/howto/custom-management-commands.txt
5@@ -97,6 +97,10 @@ must be added to :attr:`~BaseCommand.option_list` like this:
6             )
7         # ...
8 
9+The option (``delete`` in our example) is then available in the options dict
10+parameter of the handle method. See the :py:mod:`optparse` Python documentation
11+for more about ``make_option`` usage.
12+
13 In addition to being able to add custom command line options, all
14 :doc:`management commands</ref/django-admin>` can accept some
15 default options such as :djadminopt:`--verbosity` and :djadminopt:`--traceback`.