"Fossies" - the Fresh Open Source Software Archive

Member "bup-0.30/cmd/rm-cmd.py" (28 Sep 2019, 976 Bytes) of package /linux/privat/bup-0.30.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "rm-cmd.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.29.3_vs_0.30.

    1 #!/bin/sh
    2 """": # -*-python-*-
    3 bup_python="$(dirname "$0")/bup-python" || exit $?
    4 exec "$bup_python" "$0" ${1+"$@"}
    5 """
    6 # end of bup preamble
    7 
    8 from __future__ import absolute_import
    9 import sys
   10 
   11 from bup.git import check_repo_or_die
   12 from bup.options import Options
   13 from bup.helpers import die_if_errors, handle_ctrl_c, log
   14 from bup.repo import LocalRepo
   15 from bup.rm import bup_rm
   16 
   17 optspec = """
   18 bup rm <branch|save...>
   19 --
   20 #,compress=  set compression level to # (0-9, 9 is highest) [6]
   21 v,verbose    increase verbosity (can be specified multiple times)
   22 unsafe       use the command even though it may be DANGEROUS
   23 """
   24 
   25 handle_ctrl_c()
   26 
   27 o = Options(optspec)
   28 opt, flags, extra = o.parse(sys.argv[1:])
   29 
   30 if not opt.unsafe:
   31     o.fatal('refusing to run dangerous, experimental command without --unsafe')
   32 
   33 if len(extra) < 1:
   34     o.fatal('no paths specified')
   35 
   36 check_repo_or_die()
   37 repo = LocalRepo()
   38 bup_rm(repo, extra, compression=opt.compress, verbosity=opt.verbose)
   39 die_if_errors()