Changed main function to support setuptools entry_points console_scripts generation.
This commit is contained in:
parent
5c9d372f2a
commit
96dcbc1aab
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
|
||||||
|
|
Loading…
Reference in a new issue