11 from arvados._version import __version__
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,
17 help="The file to extract from the input manifest")
18 parser.add_argument('--strip', action='store_true',
19 help="Strip authorization tokens")
20 parser.add_argument('--version', action='version',
21 version="%s %s" % (sys.argv[0], __version__),
22 help='Print version and exit.')
24 args = parser.parse_args()
28 cr = arvados.CollectionReader(r)
31 i = args.extract.rfind('/')
36 stream = args.extract[:i]
37 fn = args.extract[(i+1):]
38 for s in cr.all_streams():
39 if s.name() == stream:
41 sys.stdout.write(s.files()[fn].as_manifest())
43 sys.stdout.write(cr.manifest_text(strip=args.strip, normalize=True))