@@ -146,8 +146,28 @@ The ``@option`` decorator is explained in more detail below.
146146
147147Help was previously available with **--help ** and **-h **. This had a couple
148148of less-than-ideal consequences, among them the inability to use **-h ** as
149- a shortcut for **--host **. If you want to restore the original meaning of
150- **-h **,
149+ a shortcut for **--host ** or similar options.
150+
151+ *New in version 2.0.2 *
152+
153+ If you want to restore the original meaning of **-h **, set your manager's
154+ ``help_args `` attribute to a list of argument strings you want to be
155+ considered helpful.
156+
157+ manager = Manager()
158+ manager.help_args = ('-h','-?','--help)
159+
160+ You can override this list in sub-commands and -managers::
161+
162+ def talker(host='localhost'):
163+ pass
164+ ccmd = ConnectCmd(talker)
165+ ccmd.help_args = ('-?','--help)
166+ manager.add_command("connect", ccmd)
167+ manager.run()
168+
169+ so that **manager -h ** prints help, while **manager connect -h fubar.example.com **
170+ connects to a remote host.
151171
152172Adding arguments to commands
153173----------------------------
@@ -351,8 +371,8 @@ Before version 2, options and command names could be interspersed freely.
351371The author decided to discontinue this practice for a number of reasons;
352372the problem with the most impact was that it was not possible to do
353373
354- > python manage.py connect -d DEST
355- > python manage.py import -d DIR
374+ > python manage.py connect -d DEST
375+ > python manage.py import -d DIR
356376
357377as these options collided.
358378
0 commit comments