|
|
@ -28,6 +28,35 @@ from tui_rsync.cli.label_prompt import LabelPrompt
|
|
|
|
console = Console()
|
|
|
|
console = Console()
|
|
|
|
source_update = typer.Typer()
|
|
|
|
source_update = typer.Typer()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@source_update.command()
|
|
|
|
|
|
|
|
def label(
|
|
|
|
|
|
|
|
label: str = typer.Option(
|
|
|
|
|
|
|
|
None, "--label", "-l",
|
|
|
|
|
|
|
|
help="[b]The label[/] is a uniq identification of a [b]source[/].",
|
|
|
|
|
|
|
|
show_default=False
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
new_label: str = typer.Option(
|
|
|
|
|
|
|
|
None, "--new-label", "-nl",
|
|
|
|
|
|
|
|
help="[b]The new label[/] will replace the [b]old source label[/].",
|
|
|
|
|
|
|
|
show_default=False
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
[green b]Update[/] an [yellow]existing source label[/].
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
if label is None:
|
|
|
|
|
|
|
|
console.print("What is the [yellow b]old label of source[/]? ")
|
|
|
|
|
|
|
|
label = LabelPrompt.get_label_fzf()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if new_label is None:
|
|
|
|
|
|
|
|
question = "What is the [yellow b]new label of source[/]? "
|
|
|
|
|
|
|
|
new_label = LabelPrompt.ask_uuid(question)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Source.is_exist(label):
|
|
|
|
|
|
|
|
src = Source.get_source(label)
|
|
|
|
|
|
|
|
src.update_label(new_label)
|
|
|
|
|
|
|
|
|
|
|
|
@source_update.command()
|
|
|
|
@source_update.command()
|
|
|
|
def args(
|
|
|
|
def args(
|
|
|
|
label: str = typer.Option(
|
|
|
|
label: str = typer.Option(
|
|
|
|