mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Add the show all option for Source.
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user