0.0.4 version command
This commit is contained in:
parent
303963c5ae
commit
d0a3b2f5fa
@ -2,3 +2,6 @@ import os
|
||||
|
||||
CFG_DIR = os.environ.get("RESTICBACKUP_CONFIG_DIR", "/etc/resticbackup.d")
|
||||
RESTIC_BIN = os.environ.get("RESTICBACKUP_RESTIC_BIN_PATH", "restic")
|
||||
|
||||
|
||||
__version__ = "0.0.4"
|
||||
|
@ -2,6 +2,7 @@ import os
|
||||
import argparse
|
||||
import subprocess
|
||||
|
||||
from resticbackup import __version__
|
||||
from resticbackup.types import ClientConfig, load_config, load_base_config, list_configs
|
||||
from resticbackup.lib import ExecWrapper, init_ok, die, pdie, checkp, get_retention_args, \
|
||||
get_newest_snapshot, update_statefile
|
||||
@ -133,6 +134,10 @@ def cmd_exec(args, parser):
|
||||
checkp(load_config(args.name).run(args.args))
|
||||
|
||||
|
||||
def cmd_version(args, parser):
|
||||
print(__version__)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="restic wrapper")
|
||||
|
||||
@ -170,6 +175,9 @@ def main():
|
||||
p_retrieve.add_argument("name", help="backup name")
|
||||
p_retrieve.add_argument("outdir", help="file path to write to")
|
||||
|
||||
p_version = sp_action.add_parser("version", help="display program version")
|
||||
p_version.set_defaults(func=cmd_version)
|
||||
|
||||
args = parser.parse_args()
|
||||
args.func(args, parser)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user