Skip to content

Commit

Permalink
FIXED issue behave#34: behave --version
Browse files Browse the repository at this point in the history
FIXED issue behave#31: behave --format=help
  • Loading branch information
jenisys committed Feb 21, 2012
1 parent c8575a5 commit bd847ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ build
dist
__pycache__
.coverage
.ropeproject
.idea/*
.DS_Store
nosetests.xml
_build
.ropeproject
tools/virtualenvs
build.log
.idea/*
_/
_WORKSPACE/
7 changes: 5 additions & 2 deletions behave/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from behave.formatter import formatters
from behave.runner import Runner
from behave.parser import ParserError
from behave.version import VERSION

TAG_HELP = """
Scenarios inherit tags declared on the Feature level. The simplest
Expand Down Expand Up @@ -51,6 +52,9 @@ def main():
if config.tags_help:
print TAG_HELP
sys.exit(0)
if config.version:
print VERSION
sys.exit(0)

if config.lang_list:
iso_codes = languages.keys()
Expand Down Expand Up @@ -78,13 +82,12 @@ def main():

if not config.format:
config.format = ['pretty']
elif config.format == ['help']:
elif "help" in config.format:
print "Available formatters:"
formatters.list_formatters(sys.stdout)
sys.exit(0)

stream = config.output

runner = Runner(config)
try:
failed = runner.run()
Expand Down
1 change: 1 addition & 0 deletions behave/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "1.2.0-JE"
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys

from setuptools import find_packages, setup
from behave.version import VERSION

requirements = ['parse>=1.3.3']
major, minor = sys.version_info[:2]
Expand All @@ -15,10 +16,10 @@

setup(
name='behave',
version='1.2.0',
version=VERSION,
description='behave is behaviour-driven development, Python style',
long_description=description,
author='Benno Rice and Richard Jones',
author='Benno Rice and Richard Jones, patched by JE',
author_email='behave-users@googlegroups.com',
url='http://github.com/jeamland/behave',
packages=find_packages(),
Expand Down

0 comments on commit bd847ef

Please sign in to comment.