

def Main():
    'The main program function.\n\n  Returns:\n    A boolean containing True if successful or False if not.\n  '
    argument_parser = argparse.ArgumentParser(description='Calculates a message digest hash for every file in a directory or storage media image.')
    argument_parser.add_argument('source', nargs='?', action='store', metavar='image.raw', default=None, help='path of the directory or filename of a storage media image containing the file.')
    options = output_writer.parse_args()
    if (not options.source):
        print('Source value is missing.')
        print('')
        argument_parser.print_help()
        print('')
        return False
    logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s')
    output_writer = StdoutWriter()
    if (not output_writer.Open()):
        print('Unable to open output writer.')
        print('')
        return False
    return_value = True
    mediator = volume_scanner.RecursiveHasherVolumeScannerMediator()
    recursive_hasher = RecursiveHasher(mediator=mediator)
    try:
        base_path_specs = recursive_hasher.GetBasePathSpecs(options.source)
        if (not base_path_specs):
            print('No supported file system found in source.')
            print('')
            return False
        recursive_hasher.CalculateHashes(base_path_specs, output_writer)
        print('')
        print('Completed.')
    except KeyboardInterrupt:
        return_value = False
        print('')
        print('Aborted by user.')
    output_writer.Close()
    return return_value

dataset/ETHPy150Open log2timeline/dfvfs/examples/recursive_hasher.py Main/VarMisuse@51/163 `argument_parser`->`output_writer`