Update the replace command to show responses.

This commit is contained in:
2025-01-29 21:08:52 +02:00
parent cabcde00c7
commit 2438dead07
2 changed files with 11 additions and 2 deletions
@@ -24,14 +24,18 @@ import typer
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
from tui_rsync.core.components.backup_plan.domain import BackupPlan, Source, Destination, BackupPlanId
from tui_rsync.core.shared_kernel.components.common import Label
from tui_rsync.core.shared_kernel.ports.Exceptions import CommandException
from tui_rsync.core.shared_kernel.ports.Exceptions.query_exception import QueryException
from tui_rsync.infrastructure.configuration import CurrentConfiguration
from tui_rsync.user_interface.cli.shared_kernel.components.errors.applications.exceptions import catch_exception
console = Console()
update_backup_plan = typer.Typer()
@update_backup_plan.command()
@catch_exception(CommandException, 1)
@catch_exception(QueryException, 1)
def replace(
id: str = typer.Option(
None, "--id", "-i",
@@ -65,3 +69,5 @@ def replace(
plan = BackupPlan(id=BackupPlanId(id), label=Label(label), source=Source(source), destinations=[Destination(path) for path in destinations])
service.update(plan)
console.print("The backup plan updated.")