Skip to content

Commit 027c47b

Browse files
Fixed #983 -- Made 'django-admin.py --help' output easier to read. Thanks, Oliver
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1526 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 2863e09 commit 027c47b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ answer newbie questions, and generally made Django that much better:
7676
Luke Plant <http://lukeplant.me.uk/>
7777
phaedo <http://phaedo.cx/>
7878
plisk
79+
Oliver Rutherfurd <http://rutherfurd.net/>
7980
David Schein
8081
sopel
8182
Radek Švarz <http://www.svarz.cz/translate/>

django/bin/django-admin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
from django.core import management
33
from optparse import OptionParser
4-
import os, sys
4+
import os, sys, textwrap
55

66
ACTION_MAPPING = {
77
'adminindex': management.get_admin_index,
@@ -37,8 +37,10 @@ def get_usage():
3737
available_actions.sort()
3838
for a in available_actions:
3939
func = ACTION_MAPPING[a]
40-
usage.append(" %s %s -- %s" % (a, func.args, getattr(func, 'help_doc', func.__doc__)))
41-
return '\n'.join(usage)
40+
usage.append(" %s %s" % (a, func.args))
41+
usage.extend(textwrap.wrap(getattr(func, 'help_doc', func.__doc__), initial_indent=' ', subsequent_indent=' '))
42+
usage.append("")
43+
return '\n'.join(usage[:-1]) # Cut off last list element, an empty space.
4244

4345
class DjangoOptionParser(OptionParser):
4446
def print_usage_and_exit(self):

0 commit comments

Comments
 (0)