Commit 894b67a6 authored by Tulio Ruiz's avatar Tulio Ruiz
Browse files

[IMP] added suppor for click

parent 7026077f
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import click
import copy
import fnmatch
from six import iteritems
import os
import requirements
import sys
def gt(first, second):
......@@ -95,15 +94,14 @@ def search_reqs_files(folder_name):
return res
def main(arguments):
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('dest_file', type=str,
help='The file where all requirements will be saved')
parser.add_argument('--path', default='.', help='Path where to search')
args = parser.parse_args(arguments)
generate_merged_file(args.dest_file, args.path)
@click.command()
@click.option('--path',
default='.',
type=click.Path(exists=True, readable=True),
help='Path where you what to search the requirements files'
)
@click.argument('dest_file',
type=click.Path(file_okay=True, writable=True))
def main(dest_file, path):
generate_merged_file(dest_file, path)
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
......@@ -51,5 +51,9 @@ setup(
'Programming Language :: Python :: 3.5',
],
test_suite='tests',
tests_require=test_requirements
tests_require=test_requirements,
entry_points='''
[console_scripts]
reqgenv=reqgen.reqgen:main
'''
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment