From 33d8c301e8df1f61bb1af1a1d9c73a9c5808a6cf Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Thu, 25 Feb 2021 10:54:54 +0100 Subject: [PATCH 1/2] Removed shortened stack trace --- app/__main__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/__main__.py b/app/__main__.py index b4cd3a0..3cf4281 100644 --- a/app/__main__.py +++ b/app/__main__.py @@ -3,14 +3,6 @@ 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." From 159d3de72b53026f2bba60b143f1bfbbc73385a8 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Thu, 25 Feb 2021 10:59:59 +0100 Subject: [PATCH 2/2] Added recovery flag --- app/__main__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/__main__.py b/app/__main__.py index 3cf4281..fb38e8d 100644 --- a/app/__main__.py +++ b/app/__main__.py @@ -7,6 +7,7 @@ from parser import read_specs_file parser = argparse.ArgumentParser( description="Backup directories and Docker volumes." ) + parser.add_argument( "-f", "--file", @@ -15,6 +16,7 @@ parser.add_argument( required=True, help="File containing spec definitions.", ) + parser.add_argument( "-j", "--json", @@ -23,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." )