Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #983 -- Made 'django-admin.py --help' output easier to read. Th…

…anks, Oliver

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1526 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 027c47b9b4f88f83ec06a968e3c9264e6f878f74 1 parent 2863e09
Adrian Holovaty authored December 02, 2005
1  AUTHORS
@@ -76,6 +76,7 @@ answer newbie questions, and generally made Django that much better:
76 76
     Luke Plant <http://lukeplant.me.uk/>
77 77
     phaedo <http://phaedo.cx/>
78 78
     plisk
  79
+    Oliver Rutherfurd <http://rutherfurd.net/>
79 80
     David Schein
80 81
     sopel
81 82
     Radek Švarz <http://www.svarz.cz/translate/>
8  django/bin/django-admin.py
... ...
@@ -1,7 +1,7 @@
1 1
 #!/usr/bin/env python
2 2
 from django.core import management
3 3
 from optparse import OptionParser
4  
-import os, sys
  4
+import os, sys, textwrap
5 5
 
6 6
 ACTION_MAPPING = {
7 7
     'adminindex': management.get_admin_index,
@@ -37,8 +37,10 @@ def get_usage():
37 37
     available_actions.sort()
38 38
     for a in available_actions:
39 39
         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.
42 44
 
43 45
 class DjangoOptionParser(OptionParser):
44 46
     def print_usage_and_exit(self):

0 notes on commit 027c47b

Please sign in to comment.
Something went wrong with that request. Please try again.