#!python
"""
hashdd.py
@brad_anton

Command line interface to pyhashdd and the hashdd.com API. 

License:
 
Copyright 2015 hashdd.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from hashdd.hashddcli import hashddcli

if __name__ == '__main__':
    from sys import argv
    ns = hashddcli.parse_args(argv[1:])
    if ns is not None:
        args = vars(ns)

        command = args.get('command', None)

        h = hashddcli(
            bloom=command == 'bloom',
            compute=command == 'compute', 
            show=command == 'show', 
            filename=args.get('filename', None), 
            directory=args.get('directory', None),
            algorithms=args.get('algorithms', None),
            nomatch=args.get('nomatch', None), 
            plaintext=args.get('plaintext', None), 
            include_extensions=args.get('include_extensions', None),
            exclude_extensions=args.get('exclude_extensions', None), 
            ignore_errors=args.get('ignore_errors', False), 
            compute_all=args.get('compute_all', None))

        h.run()
    


