Example #1
0
def run(args):
    path = args['--path'] if args['--path'] else None
    method = args['--method'] if args['--method'] else 'sha1'
    bf = BFS(path=path, method=method)
    if args['--write']:
        id, size = bf.fwrite(args['--write'])
        print(id, size)
    elif args['--read']:
        print(bf.read(args['--read']))
    elif args['--stat']:
        print(bf.stat())
    elif args['--show']:
        for i in bf.get_all_id():
            print(i)