From 0da61321361974941000312d90332e7f09b9d39a Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sat, 21 Aug 2010 03:37:59 -0300 Subject: [PATCH] Made command-line too output more concise --- docs/topics/commands.rst | 18 ++++++------------ scrapy/cmdline.py | 13 ++++--------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/docs/topics/commands.rst b/docs/topics/commands.rst index f8dc7738c..82c0b4bb8 100644 --- a/docs/topics/commands.rst +++ b/docs/topics/commands.rst @@ -19,18 +19,12 @@ some usage help and the available commands:: Scrapy X.Y - no active project - Usage - ===== - - To run a command: + Usage: scrapy [options] [args] - To get help: - scrapy -h - - Available commands - ================== - + Available commands: + crawl Start crawling a spider or URL + fetch Fetch a URL using the Scrapy downloader [...] The first line will print the currently active project, if you're inside a @@ -39,8 +33,8 @@ a project it would have printed something like this:: Scrapy X.Y - project: myproject - Usage - ===== + Usage: + scrapy [options] [args] [...] diff --git a/scrapy/cmdline.py b/scrapy/cmdline.py index 0f94785b2..9ec7e6ab0 100644 --- a/scrapy/cmdline.py +++ b/scrapy/cmdline.py @@ -48,20 +48,15 @@ def _print_usage(inside_project): settings['BOT_NAME']) else: print "Scrapy %s - no active project\n" % scrapy.__version__ - print "Usage" - print "=====\n" - print "To run a command:" + print "Usage:" print " scrapy [options] [args]\n" - print "To get help:" - print " scrapy -h\n" - print "Available commands" - print "==================\n" + print "Available commands:" cmds = _get_commands_dict() for cmdname, cmdclass in sorted(cmds.iteritems()): if inside_project or not cmdclass.requires_project: - print "%s %s" % (cmdname, cmdclass.syntax()) - print " %s" % cmdclass.short_desc() + print " %-13s %s" % (cmdname, cmdclass.short_desc()) print + print 'Use "scrapy -h" for more info about a command' def check_deprecated_scrapy_ctl(argv): """Check if Scrapy was called using the deprecated scrapy-ctl command and