Skip to content

Commit 610b1f3

Browse files
committed
feat(repl): rework repl a little bit and add some new command line options
see documentation
1 parent 5792ac7 commit 610b1f3

File tree

6 files changed

+320
-129
lines changed

6 files changed

+320
-129
lines changed

docs/03_reference/cli.md

Lines changed: 89 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,15 @@ Performs static code analysis to detect syntax errors, missing keywords or
270270
variables, missing arguments, and more on the given *PATHS*. *PATHS* can be
271271
files or directories. If no PATHS are given, the current directory is used.
272272

273+
Examples:
274+
```
275+
robotcode analyze code
276+
robotcode analyze code --filter **/*.robot
277+
robotcode analyze code tests/acceptance/first.robot
278+
robotcode analyze code -mi DuplicateKeyword tests/acceptance/first.robot
279+
robotcode --format json analyze code
280+
```
281+
273282

274283
**Usage:**
275284
```text
@@ -285,7 +294,7 @@ robotcode analyze code [OPTIONS] [PATHS]...
285294

286295
- `-f, --filter PATTERN`
287296

288-
Glob pattern to filter files to analyze. Can be specified multiple times.
297+
Glob pattern to filter files to analyze. Can be specified multiple times.
289298

290299

291300
- `-v, --variable name:value`
@@ -303,6 +312,11 @@ robotcode analyze code [OPTIONS] [PATHS]...
303312
Additional locations where to search test libraries and other extensions when they are imported. see `robot --pythonpath` option.
304313

305314

315+
- `-mi, --modifiers-ignore CODE`
316+
317+
Specifies the diagnostics codes to ignore.
318+
319+
306320
- `--help`
307321

308322
Show this message and exit.
@@ -610,17 +624,17 @@ robotcode debug [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
610624

611625
- `--tcp [<ADDRESS>:]<PORT>`
612626

613-
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: pipe-server, mode, port, pipe-name.
627+
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: port, pipe-server, mode, pipe-name.
614628

615629

616630
- `--pipe-server NAME`
617631

618-
Run in `pipe-server` mode and listen at the given pipe name. (Equivalent to `--mode pipe-server --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: mode, port, tcp, bind, pipe-name.
632+
Run in `pipe-server` mode and listen at the given pipe name. (Equivalent to `--mode pipe-server --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: bind, mode, port, tcp, pipe-name.
619633

620634

621-
- `--mode [pipe-server|tcp]`
635+
- `--mode [tcp|pipe-server]`
622636

623-
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: pipe-server, tcp. [env var: ROBOTCODE_MODE; default: tcp]
637+
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: tcp, pipe-server. [env var: ROBOTCODE_MODE; default: tcp]
624638

625639

626640
- `--port PORT`
@@ -635,7 +649,7 @@ robotcode debug [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
635649

636650
- `--pipe-name NAME`
637651

638-
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: pipe-server, port, tcp, bind. [env var: ROBOTCODE_PIPE_NAME]
652+
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: tcp, bind, pipe-server, port. [env var: ROBOTCODE_PIPE_NAME]
639653

640654

641655
- `--version`
@@ -662,47 +676,47 @@ robotcode debug-launch [OPTIONS]
662676
**Options:**
663677
- `--stdio`
664678

665-
Run in `stdio` mode. (Equivalent to `--mode stdio`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, tcp, bind, pipe, pipe-server, pipe-name. [env var: ROBOTCODE_STDIO]
679+
Run in `stdio` mode. (Equivalent to `--mode stdio`) *NOTE:* This option is mutually exclusive with options: bind, socket, pipe, mode, port, tcp, pipe-server, pipe-name. [env var: ROBOTCODE_STDIO]
666680

667681

668682
- `--tcp [<ADDRESS>:]<PORT>`
669683

670-
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, stdio, pipe, pipe-server, pipe-name.
684+
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: socket, pipe, mode, port, stdio, pipe-server, pipe-name.
671685

672686

673687
- `--socket [<ADDRESS>:]<PORT>`
674688

675-
Run in `socket` mode and connect to the given port. (Equivalent to `--mode socket --port <port>`) *NOTE:* This option is mutually exclusive with options: mode, port, tcp, stdio, pipe, pipe-server, pipe-name.
689+
Run in `socket` mode and connect to the given port. (Equivalent to `--mode socket --port <port>`) *NOTE:* This option is mutually exclusive with options: pipe, mode, port, tcp, stdio, pipe-server, pipe-name.
676690

677691

678692
- `--pipe NAME`
679693

680-
Run in `pipe` mode and connect to the given pipe name. (Equivalent to `--mode pipe --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, tcp, stdio, bind, pipe-server, pipe-name.
694+
Run in `pipe` mode and connect to the given pipe name. (Equivalent to `--mode pipe --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: bind, socket, mode, port, tcp, stdio, pipe-server, pipe-name.
681695

682696

683697
- `--pipe-server NAME`
684698

685-
Run in `pipe-server` mode and listen at the given pipe name. (Equivalent to `--mode pipe-server --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, tcp, stdio, bind, pipe, pipe-name.
699+
Run in `pipe-server` mode and listen at the given pipe name. (Equivalent to `--mode pipe-server --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: bind, socket, pipe, mode, port, tcp, stdio, pipe-name.
686700

687701

688702
- `--mode [stdio|tcp|socket|pipe|pipe-server]`
689703

690-
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: socket, tcp, stdio, pipe, pipe-server. [env var: ROBOTCODE_MODE; default: stdio]
704+
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: socket, tcp, stdio, pipe-server, pipe. [env var: ROBOTCODE_MODE; default: stdio]
691705

692706

693707
- `--port PORT`
694708

695-
The port to listen on or connect to. (Only valid for `tcp` and `socket mode`) *NOTE:* This option is mutually exclusive with options: pipe, pipe-server, pipe-name. [env var: ROBOTCODE_PORT; default: 6611; 1<=x<=65535]
709+
The port to listen on or connect to. (Only valid for `tcp` and `socket mode`) *NOTE:* This option is mutually exclusive with options: pipe-server, pipe-name, pipe. [env var: ROBOTCODE_PORT; default: 6611; 1<=x<=65535]
696710

697711

698712
- `--bind ADDRESS`
699713

700-
Specify alternate bind address. If no address is specified `localhost` is used. (Only valid for tcp and socket mode) *NOTE:* This option is mutually exclusive with options: pipe, pipe-server, pipe-name. [env var: ROBOTCODE_BIND; default: 127.0.0.1]
714+
Specify alternate bind address. If no address is specified `localhost` is used. (Only valid for tcp and socket mode) *NOTE:* This option is mutually exclusive with options: pipe-server, pipe-name, pipe. [env var: ROBOTCODE_BIND; default: 127.0.0.1]
701715

702716

703717
- `--pipe-name NAME`
704718

705-
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: socket, port, tcp, stdio, bind, pipe, pipe-server. [env var: ROBOTCODE_PIPE_NAME]
719+
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: bind, socket, port, tcp, stdio, pipe-server, pipe. [env var: ROBOTCODE_PIPE_NAME]
706720

707721

708722
- `--version`
@@ -812,14 +826,14 @@ robotcode discover all [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
812826
Select tests/tasks or suites by longname.
813827

814828

815-
- `--exclude-by-longname TEXT`
829+
- `--version`
816830

817-
Excludes tests/tasks or suites by longname.
831+
Show the version and exit.
818832

819833

820-
- `--version`
834+
- `--exclude-by-longname TEXT`
821835

822-
Show the version and exit.
836+
Excludes tests/tasks or suites by longname.
823837

824838

825839
- `--full-paths / --no-full-paths`
@@ -911,14 +925,14 @@ robotcode discover suites [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
911925
Select tests/tasks or suites by longname.
912926

913927

914-
- `--exclude-by-longname TEXT`
928+
- `--version`
915929

916-
Excludes tests/tasks or suites by longname.
930+
Show the version and exit.
917931

918932

919-
- `--version`
933+
- `--exclude-by-longname TEXT`
920934

921-
Show the version and exit.
935+
Excludes tests/tasks or suites by longname.
922936

923937

924938
- `--full-paths / --no-full-paths`
@@ -983,14 +997,14 @@ robotcode discover tags [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
983997
Select tests/tasks or suites by longname.
984998

985999

986-
- `--exclude-by-longname TEXT`
1000+
- `--version`
9871001

988-
Excludes tests/tasks or suites by longname.
1002+
Show the version and exit.
9891003

9901004

991-
- `--version`
1005+
- `--exclude-by-longname TEXT`
9921006

993-
Show the version and exit.
1007+
Excludes tests/tasks or suites by longname.
9941008

9951009

9961010
- `--help`
@@ -1040,14 +1054,14 @@ robotcode discover tasks [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
10401054
Select tests/tasks or suites by longname.
10411055

10421056

1043-
- `--exclude-by-longname TEXT`
1057+
- `--version`
10441058

1045-
Excludes tests/tasks or suites by longname.
1059+
Show the version and exit.
10461060

10471061

1048-
- `--version`
1062+
- `--exclude-by-longname TEXT`
10491063

1050-
Show the version and exit.
1064+
Excludes tests/tasks or suites by longname.
10511065

10521066

10531067
- `--help`
@@ -1097,14 +1111,14 @@ robotcode discover tests [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
10971111
Select tests/tasks or suites by longname.
10981112

10991113

1100-
- `--exclude-by-longname TEXT`
1114+
- `--version`
11011115

1102-
Excludes tests/tasks or suites by longname.
1116+
Show the version and exit.
11031117

11041118

1105-
- `--version`
1119+
- `--exclude-by-longname TEXT`
11061120

1107-
Show the version and exit.
1121+
Excludes tests/tasks or suites by longname.
11081122

11091123

11101124
- `--help`
@@ -1132,42 +1146,42 @@ robotcode language-server [OPTIONS] [PATHS]...
11321146
**Options:**
11331147
- `--stdio`
11341148

1135-
Run in `stdio` mode. (Equivalent to `--mode stdio`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, tcp, bind, pipe, pipe-name. [env var: ROBOTCODE_STDIO]
1149+
Run in `stdio` mode. (Equivalent to `--mode stdio`) *NOTE:* This option is mutually exclusive with options: bind, socket, pipe, mode, port, tcp, pipe-name. [env var: ROBOTCODE_STDIO]
11361150

11371151

11381152
- `--tcp [<ADDRESS>:]<PORT>`
11391153

1140-
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, stdio, pipe, pipe-name.
1154+
Run in `tcp` server mode and listen at the given port. (Equivalent to `--mode tcp --port <port>`) *NOTE:* This option is mutually exclusive with options: socket, pipe, mode, port, stdio, pipe-name.
11411155

11421156

11431157
- `--socket [<ADDRESS>:]<PORT>`
11441158

1145-
Run in `socket` mode and connect to the given port. (Equivalent to `--mode socket --port <port>`) *NOTE:* This option is mutually exclusive with options: mode, port, tcp, stdio, pipe, pipe-name.
1159+
Run in `socket` mode and connect to the given port. (Equivalent to `--mode socket --port <port>`) *NOTE:* This option is mutually exclusive with options: pipe, mode, port, tcp, stdio, pipe-name.
11461160

11471161

11481162
- `--pipe NAME`
11491163

1150-
Run in `pipe` mode and connect to the given pipe name. (Equivalent to `--mode pipe --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: mode, socket, port, tcp, stdio, bind, pipe-name.
1164+
Run in `pipe` mode and connect to the given pipe name. (Equivalent to `--mode pipe --pipe-name <name>`) *NOTE:* This option is mutually exclusive with options: bind, socket, mode, port, tcp, stdio, pipe-name.
11511165

11521166

1153-
- `--mode [pipe|socket|tcp|stdio]`
1167+
- `--mode [tcp|stdio|socket|pipe]`
11541168

1155-
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: pipe, socket, tcp, stdio. [env var: ROBOTCODE_MODE; default: stdio]
1169+
The mode to use for the debug launch server. *NOTE:* This option is mutually exclusive with options: tcp, stdio, socket, pipe. [env var: ROBOTCODE_MODE; default: stdio]
11561170

11571171

11581172
- `--port PORT`
11591173

1160-
The port to listen on or connect to. (Only valid for `tcp` and `socket mode`) *NOTE:* This option is mutually exclusive with options: pipe, pipe-name. [env var: ROBOTCODE_PORT; default: 6610; 1<=x<=65535]
1174+
The port to listen on or connect to. (Only valid for `tcp` and `socket mode`) *NOTE:* This option is mutually exclusive with options: pipe-name, pipe. [env var: ROBOTCODE_PORT; default: 6610; 1<=x<=65535]
11611175

11621176

11631177
- `--bind ADDRESS`
11641178

1165-
Specify alternate bind address. If no address is specified `localhost` is used. (Only valid for tcp and socket mode) *NOTE:* This option is mutually exclusive with options: pipe, pipe-name. [env var: ROBOTCODE_BIND; default: 127.0.0.1]
1179+
Specify alternate bind address. If no address is specified `localhost` is used. (Only valid for tcp and socket mode) *NOTE:* This option is mutually exclusive with options: pipe-name, pipe. [env var: ROBOTCODE_BIND; default: 127.0.0.1]
11661180

11671181

11681182
- `--pipe-name NAME`
11691183

1170-
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: socket, port, tcp, stdio, bind, pipe. [env var: ROBOTCODE_PIPE_NAME]
1184+
The pipe to listen on or connect to. (Only valid in `pipe` and `pipe-server` mode) *NOTE:* This option is mutually exclusive with options: bind, socket, port, tcp, stdio, pipe. [env var: ROBOTCODE_PIPE_NAME]
11711185

11721186

11731187
- `--version`
@@ -1363,16 +1377,41 @@ robotcode repl [OPTIONS] [FILES]...
13631377
Additional locations where to search test libraries and other extensions when they are imported. see `robot --pythonpath` option.
13641378

13651379

1366-
- `-d, --outputdir dir`
1380+
- `-k, --show-keywords`
13671381

1368-
Where to create output files. see `robot --outputdir` option.
1382+
Executed keywords will be shown in the output.
13691383

13701384

13711385
- `-i, --inspect`
13721386

13731387
Activate inspection mode. This forces a prompt to appear after the REPL script is executed.
13741388

13751389

1390+
- `-d, --outputdir DIR`
1391+
1392+
Where to create output files. see `robot --outputdir` option.
1393+
1394+
1395+
- `-o, --output FILE`
1396+
1397+
XML output file. see `robot --output` option.
1398+
1399+
1400+
- `-r, --report FILE`
1401+
1402+
HTML output file. see `robot --report` option.
1403+
1404+
1405+
- `-l, --log FILE`
1406+
1407+
HTML log file. see `robot --log` option.
1408+
1409+
1410+
- `-x, --xunit FILE`
1411+
1412+
xUnit output file. see `robot --xunit` option.
1413+
1414+
13761415
- `--help`
13771416

13781417
Show this message and exit.
@@ -1407,14 +1446,14 @@ robotcode robot [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
14071446
Select tests/tasks or suites by longname.
14081447

14091448

1410-
- `--exclude-by-longname TEXT`
1449+
- `--version`
14111450

1412-
Excludes tests/tasks or suites by longname.
1451+
Show the version and exit.
14131452

14141453

1415-
- `--version`
1454+
- `--exclude-by-longname TEXT`
14161455

1417-
Show the version and exit.
1456+
Excludes tests/tasks or suites by longname.
14181457

14191458

14201459
- `--help`

packages/repl/src/robotcode/repl/Repl/repl.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
from typing import List
32

43
from ..__version__ import __version__
54

@@ -13,6 +12,3 @@ def repl(self) -> None:
1312

1413
def exit(self, exit_code: int = 0) -> None:
1514
sys.exit(exit_code)
16-
17-
def keywords(self) -> List[str]:
18-
return ["repl", "exit"]

0 commit comments

Comments
 (0)