3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
10 from bup import git, options
11 from bup.helpers import handle_ctrl_c, log, qprogress, saved_errors
15 bup list-idx [--find=<prefix>] <idxfilenames...>
17 find= display only objects that start with <prefix>
19 o = options.Options(optspec)
20 (opt, flags, extra) = o.parse(sys.argv[1:])
23 opt.find = opt.find or ''
26 o.fatal('you must provide at least one filename')
28 if len(opt.find) > 40:
29 o.fatal('--find parameter must be <= 40 chars long')
38 o.fatal('--find parameter is not a valid hex string')
40 find = opt.find.lower()
45 ix = git.open_idx(name)
46 except git.GitError as e:
47 add_error('%s: %s' % (name, e))
49 if len(opt.find) == 40:
53 # slow, exhaustive search
55 i = str(_i).encode('hex')
56 if i.startswith(find):
58 qprogress('Searching: %d\r' % count)
62 log('WARNING: %d errors encountered while saving.\n' % len(saved_errors))