This repository has been archived on 2026-01-06. You can view files and clone it, but cannot push or open issues/pull-requests.
1 changed files with
13 additions and
8 deletions
|
|
|
|
@ -3,18 +3,11 @@ import sys
|
|
|
|
|
from parser import read_specs_file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This just displays the error type and message, not the stack trace
|
|
|
|
|
def except_hook(ext_type, value, traceback):
|
|
|
|
|
sys.stderr.write("{}: {}\n".format(ext_type.__name__, value))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sys.excepthook = except_hook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define parser
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
|
description="Backup directories and Docker volumes."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
parser.add_argument(
|
|
|
|
|
"-f",
|
|
|
|
|
"--file",
|
|
|
|
|
@ -23,6 +16,7 @@ parser.add_argument(
|
|
|
|
|
required=True,
|
|
|
|
|
help="File containing spec definitions.",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
parser.add_argument(
|
|
|
|
|
"-j",
|
|
|
|
|
"--json",
|
|
|
|
|
@ -31,6 +25,17 @@ parser.add_argument(
|
|
|
|
|
default=False,
|
|
|
|
|
help="Print out the parsed specs as JSON and exit",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
parser.add_argument(
|
|
|
|
|
"-r",
|
|
|
|
|
"--recover",
|
|
|
|
|
action="append",
|
|
|
|
|
nargs=2,
|
|
|
|
|
metavar=("SPEC", "BACKUP"),
|
|
|
|
|
dest="recovers",
|
|
|
|
|
help="Recover the given spec; requires two arguments",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
parser.add_argument(
|
|
|
|
|
"spec", nargs="*", help="The specs to process. Defaults to all."
|
|
|
|
|
)
|
|
|
|
|
|