From 5d82c0a97628f42e08821bf10745ff3faefe4289 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 21 Oct 2009 14:54:43 -0400 Subject: Cleaned up documentation output from commandline --help option. --- .gitignore | 1 + markdown/commandline.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0238e63..5bdf1c3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tmp/* build/* dist/* +MANIFEST diff --git a/markdown/commandline.py b/markdown/commandline.py index ac6d710..dce2b8a 100644 --- a/markdown/commandline.py +++ b/markdown/commandline.py @@ -14,9 +14,13 @@ def parse_options(): """ Define and parse `optparse` options for command-line usage. """ - - parser = optparse.OptionParser(usage="%prog [options] INPUTFILE", - version="%%prog %s" % markdown.version) + usage = """%prog [options] [INPUTFILE] + (STDIN is assumed if no INPUTFILE is given)""" + desc = "A Python implementation of John Gruber's Markdown. " \ + "http://www.freewisdom.org/projects/python-markdown/" + ver = "%%prog %s" % markdown.version + + parser = optparse.OptionParser(usage=usage, description=desc, version=ver) parser.add_option("-f", "--file", dest="filename", default=sys.stdout, help="write output to OUTPUT_FILE", metavar="OUTPUT_FILE") @@ -30,10 +34,10 @@ def parse_options(): help="print info messages") parser.add_option("-s", "--safe", dest="safe", default=False, metavar="SAFE_MODE", - help="safe mode ('replace', 'remove' or 'escape' user's HTML tag)") + help="'replace', 'remove' or 'escape' HTML tags in input") parser.add_option("-o", "--output_format", dest="output_format", default='xhtml1', metavar="OUTPUT_FORMAT", - help="Format of output. One of 'xhtml1' (default) or 'html4'.") + help="'xhtml1' (default) or 'html4'.") parser.add_option("--noisy", action="store_const", const=DEBUG, dest="verbose", help="print debug messages") -- cgit v1.2.3