From 243f6dd416fbcd62ecf42dfe3b5816f3c90faa0e Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 21 Oct 2009 10:39:10 -0400 Subject: Added a --version option to the commandline script. I thought we already had this. Not sure when we lost it. --- markdown/commandline.py | 5 +++-- 1 file 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") -- cgit v1.2.3