mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
(Added) update label option for groups.
Added Drone CI/CD pipeline config.
This commit is contained in:
@@ -30,6 +30,35 @@ from typer.main import get_group
|
||||
console = Console()
|
||||
group_update = typer.Typer()
|
||||
|
||||
@group_update.command()
|
||||
def label(
|
||||
group_label: str = typer.Option(
|
||||
None, "--group-label", "-l",
|
||||
help="[b]The label[/] is a uniq identification of a [b]group[/].",
|
||||
show_default=False
|
||||
),
|
||||
new_group_label: str = typer.Option(
|
||||
None, "--new-group-label", "-nl",
|
||||
help="[b]The new label[/] will replace the [b]old group label[/].",
|
||||
show_default=False
|
||||
),
|
||||
|
||||
):
|
||||
"""
|
||||
[green b]Update[/] an [yellow]existing group label[/].
|
||||
"""
|
||||
if group_label is None:
|
||||
console.print("What is the [yellow b]old label of group[/]? ")
|
||||
group_label = GroupPrompt.get_label_fzf()
|
||||
|
||||
if new_group_label is None:
|
||||
question = "What is the [yellow b]new label of the group[/]? "
|
||||
new_group_label = GroupPrompt.ask_uuid(question)
|
||||
|
||||
if Group.is_exist(group_label):
|
||||
group = Group.get_group(group_label)
|
||||
group.update_label(new_group_label)
|
||||
|
||||
@group_update.command()
|
||||
def labels(
|
||||
group_label: str = typer.Option(
|
||||
|
||||
@@ -50,7 +50,7 @@ def label(
|
||||
label = LabelPrompt.get_label_fzf()
|
||||
|
||||
if new_label is None:
|
||||
question = "What is the [yellow b]new label of source[/]? "
|
||||
question = "What is the [yellow b]new label of the source[/]? "
|
||||
new_label = LabelPrompt.ask_uuid(question)
|
||||
|
||||
if Source.is_exist(label):
|
||||
|
||||
Reference in New Issue
Block a user