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
|
||||
|
||||
|
||||
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:
|
||||
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue