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

View file

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