]> arthur.barton.de Git - bup.git/blobdiff - cmd/drecurse-cmd.py
Set pipefail so that "x | y || exit $?" will work properly.
[bup.git] / cmd / drecurse-cmd.py
index 74249c993b8be352525131faa150f6024a053e82..218b2ef077fee395809e8a3ff96f2d729e9fa9c3 100755 (executable)
@@ -6,22 +6,20 @@ optspec = """
 bup drecurse <path>
 --
 x,xdev,one-file-system   don't cross filesystem boundaries
-exclude= a comma-seperated list of paths to exclude from the backup
+exclude= a path to exclude from the backup (can be used more than once)
+exclude-from= a file that contains exclude paths (can be used more than once)
 q,quiet  don't actually print filenames
 profile  run under the python profiler
 """
-o = options.Options('bup drecurse', optspec)
+o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if len(extra) != 1:
     o.fatal("exactly one filename expected")
 
-if opt.exclude:
-    excluded_paths = [realpath(x) for x in opt.exclude.split(",")]
-else:
-    excluded_paths = None
+excluded_paths = parse_excludes(flags, o.fatal)
 
-it = drecurse.recursive_dirlist(extra, opt.xdev, excluded_paths)
+it = drecurse.recursive_dirlist(extra, opt.xdev, excluded_paths=excluded_paths)
 if opt.profile:
     import cProfile
     def do_it():