Skip to content

Commit

Permalink
Fixed #9158 -- Changed django-admin.py help to be printed to stdout i…
Browse files Browse the repository at this point in the history
…nstead of stderr, so that it's more easily greppable. Thanks, petr.marhoun@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Mar 26, 2011
1 parent 5d85460 commit 471c9ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions django/core/management/__init__.py
Expand Up @@ -365,7 +365,7 @@ def execute(self):
self.fetch_command(args[2]).print_help(self.prog_name, args[2])
else:
parser.print_lax_help()
sys.stderr.write(self.main_help_text() + '\n')
sys.stdout.write(self.main_help_text() + '\n')
sys.exit(1)
# Special-cases: We want 'django-admin.py --version' and
# 'django-admin.py --help' to work, for backwards compatibility.
Expand All @@ -374,7 +374,7 @@ def execute(self):
pass
elif self.argv[1:] in (['--help'], ['-h']):
parser.print_lax_help()
sys.stderr.write(self.main_help_text() + '\n')
sys.stdout.write(self.main_help_text() + '\n')
else:
self.fetch_command(subcommand).run_from_argv(self.argv)

Expand Down
4 changes: 2 additions & 2 deletions tests/regressiontests/admin_scripts/tests.py
Expand Up @@ -1113,7 +1113,7 @@ def test_help(self):
self.assertOutput(out, "usage: manage.py subcommand [options] [args]")
else:
self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
self.assertOutput(err, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")

def test_short_help(self):
"-h is handled as a short form of --help"
Expand All @@ -1123,7 +1123,7 @@ def test_short_help(self):
self.assertOutput(out, "usage: manage.py subcommand [options] [args]")
else:
self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
self.assertOutput(err, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")

def test_specific_help(self):
"--help can be used on a specific command"
Expand Down

0 comments on commit 471c9ae

Please sign in to comment.