From f2e70ccc85fec6299a6fad734331defbb5deebcc Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sat, 1 Jul 2023 11:34:58 +0300 Subject: [PATCH] Add the show all option for Group. --- CHANGELOG.org | 2 ++ pyproject.toml | 2 +- tui_rsync/cli/groups/group_show.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 2bf6000..a7d7a68 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -59,4 +59,6 @@ Added *show one* option for Group. ** 0.8.15 <2023-06-26 Mon> Added *show all* option for Source. +** 0.8.16 <2023-07-01 Sat> + Added *show all* option for Group. diff --git a/pyproject.toml b/pyproject.toml index 8151a35..5445229 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tui-rsync" -version = "0.8.15" +version = "0.8.16" description = "tui-rsync will help you to manage yours backups." authors = ["Kostiantyn Klochko "] readme = "README.rst" diff --git a/tui_rsync/cli/groups/group_show.py b/tui_rsync/cli/groups/group_show.py index 385d574..01a1b13 100644 --- a/tui_rsync/cli/groups/group_show.py +++ b/tui_rsync/cli/groups/group_show.py @@ -24,6 +24,7 @@ import typer from tui_rsync.models.models import Group, GroupSource from tui_rsync.cli.groups.group_prompt import GroupPrompt +from tui_rsync.models.models import all_group_labels console = Console() group_show = typer.Typer() @@ -51,3 +52,12 @@ def one( console.print(group.show_format()) +@group_show.command() +def all(): + """ + [green b]Show[/] [yellow]all existing groups[/]. + """ + for label in all_group_labels().iterator(): + group = Group.get_group(label.label) + console.print(group.show_format()) +