mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37:43 +00:00
Update the replace command to show responses.
This commit is contained in:
@@ -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.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user