Skip to content

Commit

Permalink
Bump version and add a --version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 31, 2016
1 parent d110973 commit 62606f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(name='webdiff',
version='0.12.0',
version='0.12.1',
description='Two-column web-based git difftool',
author='Dan Vanderkam',
author_email='[email protected]',
Expand Down
4 changes: 3 additions & 1 deletion webdiff/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import util
import argparser

VERSION = '0.12.1'


def determine_path():
"""Borrowed from wxglade.py"""
Expand Down Expand Up @@ -265,7 +267,7 @@ def is_webdiff_from_head():
def run():
global DIFF, PORT
try:
parsed_args = argparser.parse(sys.argv[1:])
parsed_args = argparser.parse(sys.argv[1:], VERSION)
except argparser.UsageError as e:
sys.stderr.write('Error: %s\n\n' % e.message)
usage_and_die()
Expand Down
3 changes: 2 additions & 1 deletion webdiff/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ class UsageError(Exception):
PULL_REQUEST_RE = re.compile(r'http[s]://(?:www.)?github.com\/([^/]+)/([^/]+)/pull/([0-9]+)(?:/.*)?')
PULL_REQUEST_NUM_RE = re.compile(r'^#([0-9]+)$')

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

0 comments on commit 62606f2

Please sign in to comment.