From a1bcf572e1aee3955a8f62711b0152f0aff5a098 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Wed, 22 Mar 2023 15:54:02 +0200 Subject: [PATCH] (Added) remove all option for sources. --- CHANGELOG.org | 2 ++ tui_rsync/cli/source/source_remove.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.org b/CHANGELOG.org index bb44bbc..1cb6039 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -35,4 +35,6 @@ ** 0.8.4 <2023-03-21 Tue> Added remove option for groups. Moved groups logic to .cli.groups. +** 0.8.5 <2023-03-22 Tue> + Added *remove all* option for sources. diff --git a/tui_rsync/cli/source/source_remove.py b/tui_rsync/cli/source/source_remove.py index d9fea32..c85f8f2 100644 --- a/tui_rsync/cli/source/source_remove.py +++ b/tui_rsync/cli/source/source_remove.py @@ -24,6 +24,7 @@ import typer from tui_rsync.models.models import Source, Destination, SyncCommand, Path from tui_rsync.cli.label_prompt import LabelPrompt +from tui_rsync.models.models import all_labels console = Console() source_remove = typer.Typer() @@ -46,3 +47,10 @@ def one( src = Source.get_source(label) src.delete_instance() +@source_remove.command() +def all(): + """ + [red b]Remove[/] [yellow] all existing sources[/]. + """ + for label in all_labels().iterator(): + one(label.label)