Skip to content

Commit

Permalink
Merge pull request #99 from elyezer/click
Browse files Browse the repository at this point in the history
Use Click library instead of argparse
  • Loading branch information
sthirugn committed Jun 13, 2016
2 parents a688ba6 + 1e88007 commit bc3585f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 56 deletions.
3 changes: 0 additions & 3 deletions bin/testimony

This file was deleted.

6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
author='Suresh Thirugn',
author_email='sthirugn@redhat.com',
packages=['testimony'],
scripts=['bin/testimony'],
install_requires=['Click'],
entry_points='''
[console_scripts]
testimony=testimony.cli:testimony
''',
description='Testimony inspects and reports on the python test cases.',
long_description=long_description,
license=license,
Expand Down
52 changes: 0 additions & 52 deletions testimony/__main__.py

This file was deleted.

23 changes: 23 additions & 0 deletions testimony/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# coding=utf-8
"""Testimony CLI utilities."""
import click

from testimony import main
from testimony.constants import REPORT_TAGS


@click.command()
@click.option('-j', '--json', help='JSON output', is_flag=True)
@click.option('-n', '--nocolor', default=False, help='Color output',
is_flag=True)
@click.option(
'-t', '--tag', multiple=True,
help='specify a tag to search. This option can be specified multiple '
'times. Note: Always run this only in the root of the project where '
'test cases are stored'
)
@click.argument('report', type=click.Choice(REPORT_TAGS))
@click.argument('path', nargs=-1, type=click.Path(exists=True))
def testimony(json, nocolor, tag, report, path):
"""Inspects and report on the Python test cases."""
main(report, path, json, nocolor, tag)

0 comments on commit bc3585f

Please sign in to comment.