2 from __future__ import absolute_import
4 from bup import git, options
5 from bup.gc import bup_gc
6 from bup.helpers import die_if_errors
12 v,verbose increase log output (can be used more than once)
13 threshold= only rewrite a packfile if it's over this percent garbage [10]
14 #,compress= set compression level to # (0-9, 9 is highest) [1]
15 unsafe use the command even though it may be DANGEROUS
19 # FIXME: make sure client handles server-side changes reasonably
22 o = options.Options(optspec)
23 opt, flags, extra = o.parse_bytes(argv[1:])
26 o.fatal('refusing to run dangerous, experimental command without --unsafe')
29 o.fatal('no positional parameters expected')
33 opt.threshold = int(opt.threshold)
35 o.fatal('threshold must be an integer percentage value')
36 if opt.threshold < 0 or opt.threshold > 100:
37 o.fatal('threshold must be an integer percentage value')
39 git.check_repo_or_die()
41 bup_gc(threshold=opt.threshold,
42 compression=opt.compress,
43 verbosity=opt.verbose)