More command cleanup

This commit is contained in:
einarf
2023-03-09 01:42:27 +01:00
parent 01ae6ee0bf
commit 70afcd2c6a
6 changed files with 165 additions and 198 deletions

View File

@@ -1,4 +1,5 @@
from .base import BaseCommand
from restic_compose_backup import restic
class Command(BaseCommand):
@@ -6,4 +7,7 @@ class Command(BaseCommand):
name = "snapshots"
def run(self):
print("Snapshots!")
"""Display restic snapshots"""
stdout, stderr = restic.snapshots(self.config.repository, last=True)
for line in stdout.decode().split('\n'):
print(line)