11 logger = logging.getLogger(os.path.basename(sys.argv[0]))
13 parser = argparse.ArgumentParser(
14 description='Read manifest on standard input and put normalized manifest on standard output.')
16 parser.add_argument('--extract', type=str, help="The file to extract from the input manifest")
17 parser.add_argument('--strip', action='store_true', help="Strip authorization tokens")
19 args = parser.parse_args()
25 cr = arvados.CollectionReader(r)
28 i = args.extract.rfind('/')
33 stream = args.extract[:i]
34 fn = args.extract[(i+1):]
35 for s in cr.all_streams():
36 if s.name() == stream:
38 sys.stdout.write(s.files()[fn].as_manifest())
40 sys.stdout.write(cr.manifest_text(args.strip))