From ccf53ceb044ddd45d8a25c805ae40aff8a1371c9 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 18 Dec 2010 20:36:16 +0000 Subject: [PATCH] Add a version option. --- pelican/__init__.py | 4 ++++ setup.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 8d281745..79842f74 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -7,6 +7,8 @@ from pelican.writers import Writer from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) +VERSION = "2.5.1" + def init_params(settings=None, path=None, theme=None, output_path=None, markup=None, keep=False): @@ -99,6 +101,8 @@ def main(): action='store_true', help='Keep the output directory and just update all the generated files.' 'Default is to delete the output directory.') + parser.add_argument('--version', action='version', version=VERSION, + help="Print the pelican version and exit") args = parser.parse_args() # Split the markup languages only if some have been given. Otherwise, populate diff --git a/setup.py b/setup.py index d461cb46..86f43f0f 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import setup +from pelican import VERSION import sys requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'Markdown'] @@ -7,7 +8,7 @@ if sys.version_info < (2,7): setup( name = "pelican", - version = '2.5.1', + version = VERSION, url = 'http://alexis.notmyidea.org/pelican/', author = 'Alexis Metaireau', author_email = 'alexis@notmyidea.org',