Skip to content

Commit 934e299

Browse files
committed
feat(robotcode): internal cli args are now hidden
If you want to show these args set the environment variable `ROBOTCODE_SHOW_HIDDEN_ARGS` to `true` or `1`.
1 parent 9b9021b commit 934e299

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

packages/core/src/robotcode/core/lsp/__init__.py

Whitespace-only changes.

packages/core/src/robotcode/core/utils/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
3+
4+
def show_hidden_arguments() -> bool:
5+
return os.environ.get("ROBOTCODE_SHOW_HIDDEN_ARGS", "").lower() not in ["true", "1"]

packages/debugger/src/robotcode/debugger/launcher/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import click
44
from robotcode.core.types import ServerMode
5+
from robotcode.core.utils.cli import show_hidden_arguments
56
from robotcode.plugin import Application, UnknownError, pass_application
67
from robotcode.plugin.click_helper.options import resolve_server_options, server_options
78
from robotcode.plugin.click_helper.types import (
@@ -17,7 +18,7 @@
1718

1819
@click.command(
1920
add_help_option=True,
20-
hidden=True,
21+
hidden=show_hidden_arguments(),
2122
)
2223
@add_options(*server_options(ServerMode.STDIO, default_port=LAUNCHER_DEFAULT_PORT))
2324
@click.version_option(version=__version__, prog_name="RobotCode Launcher")

packages/runner/src/robotcode/runner/cli/discover/discover.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
Range,
2929
)
3030
from robotcode.core.uri import Uri
31+
from robotcode.core.utils.cli import show_hidden_arguments
3132
from robotcode.plugin import Application, OutputFormat, UnknownError, pass_application
3233
from robotcode.plugin.click_helper.types import add_options
3334
from robotcode.robot.utils import get_robot_version
@@ -335,7 +336,7 @@ def visit_test(self, test: TestCase) -> None:
335336
"--read-from-stdin",
336337
is_flag=True,
337338
help="Read file contents from stdin. This is an internal option.",
338-
hidden=True,
339+
hidden=show_hidden_arguments(),
339340
)
340341
@pass_application
341342
def discover(app: Application, read_from_stdin: bool) -> None:

src/robotcode/cli/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import click
66
from robotcode.core.logging import LoggingDescriptor
7+
from robotcode.core.utils.cli import show_hidden_arguments
78
from robotcode.plugin import Application, ColoredOutput, OutputFormat, pass_application
89
from robotcode.plugin.click_helper.aliases import AliasedGroup
910
from robotcode.plugin.click_helper.types import EnumChoice
@@ -98,17 +99,20 @@
9899
"-dp",
99100
type=click.Path(exists=False, resolve_path=False, path_type=str),
100101
multiple=True,
101-
help="Default path to use if no path is given or defined in a profile. Can be specified multiple times.",
102+
hidden=show_hidden_arguments(),
103+
help="Default path to use if no path is given or defined in a profile. Can be specified multiple times. "
104+
"**This is an internal option for running in vscode",
102105
)
103106
@click.option(
104107
"--launcher-script",
105-
hidden=True,
108+
hidden=show_hidden_arguments(),
106109
type=str,
107110
help="Path to the launcher script. This is an internal option.",
108111
)
109112
@click.option(
110113
"--debugpy",
111114
is_flag=True,
115+
hidden=show_hidden_arguments(),
112116
help="Starts a debugpy session. "
113117
"**This is an internal option and should only be use if you want to debug _RobotCode_.**",
114118
)
@@ -117,11 +121,13 @@
117121
type=int,
118122
default=5678,
119123
show_default=True,
124+
hidden=show_hidden_arguments(),
120125
help="Defines the port to use for the debugpy session.",
121126
)
122127
@click.option(
123128
"--debugpy-wait-for-client",
124129
is_flag=True,
130+
hidden=show_hidden_arguments(),
125131
help="Waits for a debugpy client to connect before starting the debugpy session.",
126132
)
127133
@click.version_option(version=__version__, prog_name="robotcode")

0 commit comments

Comments
 (0)