Skip to content

Commit 62606f2

Browse files
committed
Bump version and add a --version flag
1 parent d110973 commit 62606f2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
setup(name='webdiff',
4-
version='0.12.0',
4+
version='0.12.1',
55
description='Two-column web-based git difftool',
66
author='Dan Vanderkam',
77
author_email='[email protected]',

webdiff/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import util
2222
import argparser
2323

24+
VERSION = '0.12.1'
25+
2426

2527
def determine_path():
2628
"""Borrowed from wxglade.py"""
@@ -265,7 +267,7 @@ def is_webdiff_from_head():
265267
def run():
266268
global DIFF, PORT
267269
try:
268-
parsed_args = argparser.parse(sys.argv[1:])
270+
parsed_args = argparser.parse(sys.argv[1:], VERSION)
269271
except argparser.UsageError as e:
270272
sys.stderr.write('Error: %s\n\n' % e.message)
271273
usage_and_die()

webdiff/argparser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ class UsageError(Exception):
2323
PULL_REQUEST_RE = re.compile(r'http[s]://(?:www.)?github.com\/([^/]+)/([^/]+)/pull/([0-9]+)(?:/.*)?')
2424
PULL_REQUEST_NUM_RE = re.compile(r'^#([0-9]+)$')
2525

26-
def parse(args):
26+
def parse(args, version=None):
2727
"""Returns {port, dirs: [], files: [], pr: {owner, repo, number}}."""
2828
parser = argparse.ArgumentParser(description='Run webdiff.', usage=USAGE)
29+
parser.add_argument('--version', action='version', version='webdiff %s' % version)
2930
parser.add_argument('--port', '-p', type=int, help="Port to run webdiff on.", default=-1)
3031
parser.add_argument('dirs', type=str, nargs='+',
3132
help="Directories to diff, or a github pull request URL.")

0 commit comments

Comments
 (0)