3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
8 from bup import git, options
9 from bup.helpers import *
12 bup list-idx [--find=<prefix>] <idxfilenames...>
14 find= display only objects that start with <prefix>
16 o = options.Options(optspec)
17 (opt, flags, extra) = o.parse(sys.argv[1:])
20 opt.find = opt.find or ''
23 o.fatal('you must provide at least one filename')
25 if len(opt.find) > 40:
26 o.fatal('--find parameter must be <= 40 chars long')
35 o.fatal('--find parameter is not a valid hex string')
37 find = opt.find.lower()
42 ix = git.open_idx(name)
43 except git.GitError, e:
44 add_error('%s: %s' % (name, e))
46 if len(opt.find) == 40:
50 # slow, exhaustive search
52 i = str(_i).encode('hex')
53 if i.startswith(find):
55 qprogress('Searching: %d\r' % count)
59 log('WARNING: %d errors encountered while saving.\n' % len(saved_errors))