aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@dev.(none)>2009-10-21 14:54:43 -0400
committerWaylan Limberg <waylan@dev.(none)>2009-10-21 14:54:43 -0400
commit5d82c0a97628f42e08821bf10745ff3faefe4289 (patch)
treeb31993492dbdad34160bf6d73887d5bd994bfb6d
parent215fa1875651547b5a1534f23cf637fb082e2a77 (diff)
downloadmarkdown-5d82c0a97628f42e08821bf10745ff3faefe4289.tar.gz
markdown-5d82c0a97628f42e08821bf10745ff3faefe4289.tar.bz2
markdown-5d82c0a97628f42e08821bf10745ff3faefe4289.zip
Cleaned up documentation output from commandline --help option.
-rw-r--r--.gitignore1
-rw-r--r--markdown/commandline.py14
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")