Confirm dialog check commented our for now. Why is that I can't intercept the dialog...
[arvados.git] / sdk / python / bin / arv-ls
1 #!/usr/bin/env python
2
3 import argparse
4 import hashlib
5 import os
6 import re
7 import string
8 import sys
9 import logging
10
11 logger = logging.getLogger(os.path.basename(sys.argv[0]))
12
13 parser = argparse.ArgumentParser(
14     description='List contents of a manifest')
15
16 parser.add_argument('locator', type=str,
17                     help="""
18 Collection locator
19 """)
20
21 parser.add_argument('-s', action='store_true', help="""List file sizes, in KiB.""")
22
23 args = parser.parse_args()
24
25 import arvados
26
27 cr = arvados.CollectionReader(arvados.Keep.get(args.locator))
28
29 for f in cr.all_files():
30     if args.s:
31         print "{:>10} {}".format(f.size() / 1024, f.stream_name() + "/" + f.name())
32     else:
33         print f.stream_name() + "/" + f.name()