|
|
@ -57,6 +57,34 @@ def label(
|
|
|
|
src = Source.get_source(label)
|
|
|
|
src = Source.get_source(label)
|
|
|
|
src.update_label(new_label)
|
|
|
|
src.update_label(new_label)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@source_update.command()
|
|
|
|
|
|
|
|
def source(
|
|
|
|
|
|
|
|
label: str = typer.Option(
|
|
|
|
|
|
|
|
None, "--label", "-l",
|
|
|
|
|
|
|
|
help="[b]The label[/] is a uniq identification of a [b]source[/].",
|
|
|
|
|
|
|
|
show_default=False
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
new_source_path: str = typer.Option(
|
|
|
|
|
|
|
|
None, "--new-label", "-nl",
|
|
|
|
|
|
|
|
help="[b]The new source[/] will replace the [b]old source[/].",
|
|
|
|
|
|
|
|
show_default=False
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
[green b]Update[/] a source path of an [yellow]existing source[/].
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
if label is None:
|
|
|
|
|
|
|
|
console.print("What is the [yellow b]label of source[/]? ")
|
|
|
|
|
|
|
|
label = LabelPrompt.get_label_fzf()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if new_source_path is None:
|
|
|
|
|
|
|
|
question = "What is the [yellow b]new source path of the source[/]? "
|
|
|
|
|
|
|
|
new_source_path = console.input(question)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Source.is_exist(label):
|
|
|
|
|
|
|
|
src = Source.get_source(label)
|
|
|
|
|
|
|
|
src.update_source_path(new_source_path)
|
|
|
|
|
|
|
|
|
|
|
|
@source_update.command()
|
|
|
|
@source_update.command()
|
|
|
|
def args(
|
|
|
|
def args(
|
|
|
|
label: str = typer.Option(
|
|
|
|
label: str = typer.Option(
|
|
|
|