aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@dev.(none)>2009-10-21 10:39:10 -0400
committerWaylan Limberg <waylan@dev.(none)>2009-10-21 10:39:10 -0400
commit243f6dd416fbcd62ecf42dfe3b5816f3c90faa0e (patch)
tree487bfb7731ff299a9c54291558a9570480ed1eb0
parent067d88bc41c7924c9087b724ff5247235243ce6b (diff)
downloadmarkdown-243f6dd416fbcd62ecf42dfe3b5816f3c90faa0e.tar.gz
markdown-243f6dd416fbcd62ecf42dfe3b5816f3c90faa0e.tar.bz2
markdown-243f6dd416fbcd62ecf42dfe3b5816f3c90faa0e.zip
Added a --version option to the commandline script. I thought we already had this. Not sure when we lost it.
-rw-r--r--markdown/commandline.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown/commandline.py b/markdown/commandline.py
index 1eedc6d..78dfc5a 100644
--- a/markdown/commandline.py
+++ b/markdown/commandline.py
@@ -11,7 +11,7 @@ import sys
import logging
from logging import DEBUG, INFO, WARN, ERROR, CRITICAL
-EXECUTABLE_NAME_FOR_USAGE = "python markdown.py"
+EXECUTABLE_NAME_FOR_USAGE = "python markdown"
""" The name used in the usage statement displayed for python versions < 2.3.
(With python 2.3 and higher the usage statement is generated by optparse
and uses the actual name of the executable called.) """
@@ -42,7 +42,8 @@ def parse_options():
print OPTPARSE_WARNING
return None, None
- parser = optparse.OptionParser(usage="%prog INPUTFILE [options]")
+ parser = optparse.OptionParser(usage="%prog INPUTFILE [options]",
+ version="%%prog %s" % markdown.version)
parser.add_option("-f", "--file", dest="filename", default=sys.stdout,
help="write output to OUTPUT_FILE",
metavar="OUTPUT_FILE")