Add the show all option for Source.

This commit is contained in:
2023-06-26 18:11:14 +03:00
parent 8fe226b282
commit 21fde3deb0
3 changed files with 15 additions and 2 deletions
+12 -1
View File
@@ -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_show = typer.Typer()
@@ -37,7 +38,7 @@ def one(
),
):
"""
[green b]Show[/] an [yellow]existing source label[/].
[green b]Show[/] an [yellow]existing source[/].
"""
if label is None:
console.print("What is the [yellow b]label of source[/]? ")
@@ -51,3 +52,13 @@ def one(
console.print(source.show_format())
@source_show.command()
def all():
"""
[green b]Show[/] [yellow]all existing sources[/].
"""
for label in all_labels().iterator():
source = Source.get_source(label.label)
console.print(source.show_format())