Skip to content

Commit 7bc7099

Browse files
committed
doc: correct some docs for CLI interface
1 parent ced5372 commit 7bc7099

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.vscode/launch.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"request": "launch",
2121
"module": "robotcode.cli",
2222
"justMyCode": false,
23-
"cwd": "${workspaceFolder}/tests/robotcode/language_server/robotframework/parts/data/tests",
23+
//"cwd": "${workspaceFolder}/tests/robotcode/language_server/robotframework/parts/data/tests",
24+
"cwd": "E:\\tmp\\rfalpha",
2425
//"cwd": "C:\\develop\\robot\\robotframework",
2526
// "env": {
2627
// "ROBOTCODE_COLOR": "1",
@@ -43,8 +44,8 @@
4344
// "--no-color",
4445
// "--no-pager",
4546
//"config", "info", "list",
46-
"analyze",
47-
// "profiles", "list"
47+
// "analyze",
48+
"profiles", "list"
4849
// "discover", "tests", "--tags"
4950
// "."
5051
]

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/robotcode/cli/commands/config.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
invoke_without_command=False,
2222
)
2323
def config() -> None:
24-
"""\
25-
View configuration informations.
26-
"""
24+
"""Shows information about the configuration."""
2725

2826

2927
@config.command
@@ -38,7 +36,7 @@ def show(
3836
paths: List[Path],
3937
) -> None:
4038
"""\
41-
Shows the current _robot_ configuration.
39+
Shows the current configuration.
4240
4341
Takes a list of PATHS or if no PATHS are given, takes the current working directory,
4442
to search for configuration files and prints the current configuration.
@@ -76,7 +74,7 @@ def show(
7674
@pass_application
7775
def files(app: Application, paths: List[Path], user: bool = False) -> None:
7876
"""\
79-
Search for _robot_ configuration files and list them.
77+
Search for configuration files and list them.
8078
8179
Takes a list of PATHS or if no PATHS are given, takes the current working directory,
8280
to search for configuration files and prints them.
@@ -122,7 +120,7 @@ def root(
122120
paths: List[Path],
123121
) -> None:
124122
"""\
125-
Searches for the root folder of the _robot_ project and prints them.
123+
Searches for the root folder of the project and prints them.
126124
127125
Takes a list of PATHS or if no PATHS are given, takes the current working directory,
128126
to search for the root of the project and prints this.

src/robotcode/cli/commands/profiles.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
invoke_without_command=False,
1616
)
1717
def profiles() -> None:
18-
"""View _robot_ profile informations."""
18+
"""Shows information on defined profiles."""
1919

2020

2121
@profiles.command
@@ -29,7 +29,7 @@ def show(
2929
no_evaluate: bool,
3030
paths: List[Path],
3131
) -> None:
32-
"""Shows the given _robot_ profile."""
32+
"""Shows the given profile configuration."""
3333
try:
3434
config_files, _, _ = get_config_files(paths, app.config.config_files, verbose_callback=app.verbose)
3535

@@ -53,7 +53,7 @@ def list(
5353
app: Application,
5454
paths: List[Path],
5555
) -> None:
56-
"""Lists the defined profiles in the current _robot_ configuration."""
56+
"""Lists the defined profiles in the current configuration."""
5757

5858
try:
5959
config_files, _, discovered_by = get_config_files(
@@ -102,8 +102,10 @@ def check_enabled(name: str, profile: RobotProfile) -> bool:
102102
v[k] = " ".join(lines[:1]) + (" ..." if len(lines) > 1 else "")
103103

104104
header = ""
105-
max_name = max(*(len(profile["name"]) for profile in result["profiles"]), len("Name"))
106-
max_description = max(*(len(profile["description"]) for profile in result["profiles"]), len("Description"))
105+
max_name = max(0, len("Name"), *(len(profile["name"]) for profile in result["profiles"]))
106+
max_description = max(
107+
0, len("Description"), *(len(profile["description"]) for profile in result["profiles"])
108+
)
107109
header += (
108110
f'| Active | Selected | Enabled | Name{(max_name-len("Name"))*" "} '
109111
f'| Description{(max_description-len("Description"))*" "} |\n'

0 commit comments

Comments
 (0)