diff --git a/ansi2html/converter.py b/ansi2html/converter.py index df085e5..2579545 100755 --- a/ansi2html/converter.py +++ b/ansi2html/converter.py @@ -29,6 +29,7 @@ from ordereddict import OrderedDict from ansi2html.style import get_styles +from ansi2html.version import VERSION_STR import six from six.moves import map from six.moves import zip @@ -374,7 +375,7 @@ def main(): $ task burndown | ansi2html > burndown.html """ - parser = optparse.OptionParser(usage=main.__doc__) + parser = optparse.OptionParser(usage=main.__doc__, version="%%prog %s" % VERSION_STR) parser.add_option( "-p", "--partial", dest="partial", default=False, action="store_true", diff --git a/ansi2html/version.py b/ansi2html/version.py new file mode 100644 index 0000000..c9aad95 --- /dev/null +++ b/ansi2html/version.py @@ -0,0 +1,5 @@ +VERSION = (0, 10, 0) +VERSION_STR = '.'.join([str(e) for e in VERSION]) + +if __name__ == '__main__': + print(VERSION_STR) diff --git a/setup.py b/setup.py index ef7ae0f..cacf294 100755 --- a/setup.py +++ b/setup.py @@ -9,6 +9,9 @@ import sys +sys.path.insert(0, '.') +from ansi2html.version import VERSION_STR + f = open('README.rst') long_description = f.read().strip() long_description = long_description.split('split here', 1)[1] @@ -34,7 +37,7 @@ setup( name='ansi2html', - version='0.10.0', + version=VERSION_STR, description="Convert text with ANSI color codes to HTML", long_description=long_description, author='Ralph Bean',