feat: add option to add tags to db and minecraft containers

Closes #6
This commit is contained in:
Silthus
2020-11-25 19:32:32 +01:00
parent 9eb050173f
commit 3a19623351
9 changed files with 54 additions and 16 deletions

View File

@@ -82,6 +82,25 @@ def strip_root(path):
return path
def format_tags(tags: str, arg = "--tag") -> List[str]:
"""
Takes a comma separated list of tags.
Splits them and appends --tag to each tag.
Use the output as the command line argument for the restic cli.
Example: foo,bar,test becomes --tag foo --tag bar --tag test
"""
if not tags:
return []
tags = tags.strip()
splitTags = tags.split(",")
output = []
for tag in splitTags:
tag = tag.strip()
if tag:
output.extend([arg, tag])
return output
@contextmanager
def environment(name, value):