Summary
In RunContext.cli_command (nemo_run/cli/api.py, v0.9.0) two options claim the same short flag:
yaml: Optional[str] = typer.Option(None, "--yaml", "-y", help="Path to a YAML file to load"), # L894
skip_confirmation: bool = typer.Option(False, "--yes", "-y", "--no-confirm", help="Skip confirmation before execution"), # L899
so every invocation of any generated command prints:
UserWarning: The parameter -y is used more than once. Remove its duplicate as parameters should be unique.
(twice per parse: click/core.py make_parser and parse_args). Besides the noise, whichever option click resolves -y to wins silently — a user typing -y for "yes" may instead set yaml.
Minimal reproduction (nemo_run + typer only)
import warnings
import typer
from typer.testing import CliRunner
from nemo_run.cli.api import RunContext
def demo(x: int = 1) -> None:
pass
app = typer.Typer()
RunContext.cli_command(app, "demo", demo)
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter("always")
CliRunner().invoke(app, ["demo", "--help"])
print(len([w for w in caught if "-y" in str(w.message)])) # 4
Suggested fix
Drop -y from --yaml (the near-universal CLI convention reserves -y for yes/skip-confirmation), leaving --yaml long-form only.
Summary
In
RunContext.cli_command(nemo_run/cli/api.py, v0.9.0) two options claim the same short flag:so every invocation of any generated command prints:
(twice per parse:
click/core.pymake_parserandparse_args). Besides the noise, whichever option click resolves-yto wins silently — a user typing-yfor "yes" may instead setyaml.Minimal reproduction (nemo_run + typer only)
Suggested fix
Drop
-yfrom--yaml(the near-universal CLI convention reserves-yfor yes/skip-confirmation), leaving--yamllong-form only.