Changed main function to support setuptools entry_points console_scripts generation.

This commit is contained in:
darko-poljak 2014-01-27 09:17:29 +01:00
parent 5c9d372f2a
commit 96dcbc1aab
1 changed files with 5 additions and 4 deletions

View File

@ -109,11 +109,14 @@ def iter_file_dups(topdirs=['./'], hashalg='md5', block_size=4096):
yield fpaths
def main(args):
def main():
"""Main when used as script. See usage (--help).
"""
import json
from docopt import docopt
arguments = docopt(__doc__)
topdirs = args['<directory>']
if not topdirs:
topdirs = ['./']
@ -140,6 +143,4 @@ def main(args):
# if used as script call main function
if __name__ == '__main__':
from docopt import docopt
arguments = docopt(__doc__)
main(arguments)
main()