diff --git a/src/serena/cli.py b/src/serena/cli.py index c53c341e..c514fcb4 100644 --- a/src/serena/cli.py +++ b/src/serena/cli.py @@ -733,9 +733,10 @@ class ProjectCommands(AutoRegisteringGroup): @click.option( "--ls", "--language", + "language", type=str, multiple=True, - help="Programming language(s); inferred if not specified. Can be passed multiple times.", + help="Language server(s); inferred if not specified. Can be passed multiple times.", ) @click.option("--index", is_flag=True, help="Index the project after creation.") @click.option( @@ -767,9 +768,10 @@ class ProjectCommands(AutoRegisteringGroup): @click.option( "--ls", "--language", + "language", type=str, multiple=True, - help="Programming language(s) (only used if auto-creating project.yml). Inferred if not specified.", + help="Language server(s) (only used if auto-creating project.yml). Inferred if not specified.", ) @click.option( "--log-level", diff --git a/test/serena/test_cli_project_commands.py b/test/serena/test_cli_project_commands.py index 13359c87..b6a59277 100644 --- a/test/serena/test_cli_project_commands.py +++ b/test/serena/test_cli_project_commands.py @@ -7,6 +7,7 @@ import time from pathlib import Path import pytest +from click import Command, Option from click.testing import CliRunner from serena.cli import ProjectCommands, TopLevelCommands, find_project_root @@ -51,6 +52,14 @@ def cli_runner(): return CliRunner() +@pytest.mark.parametrize("command", [ProjectCommands.create, ProjectCommands.index]) +def test_language_server_aliases_bind_to_language_parameter(command: Command) -> None: + language_option = next(option for option in command.params if isinstance(option, Option) and "--ls" in option.opts) + + assert language_option.name == "language" + assert language_option.opts == ["--ls", "--language"] + + class TestProjectCreate: """Tests for 'project create' command."""