@@ -36,10 +36,13 @@ def run_repl(
36
36
variablefile : Tuple [str , ...],
37
37
pythonpath : Tuple [str , ...],
38
38
outputdir : Optional [str ],
39
- paths : Tuple [Path , ...],
39
+ files : Tuple [Path , ...],
40
40
) -> None :
41
41
robot_options_and_args : Tuple [str , ...] = ()
42
42
43
+ if files :
44
+ files = tuple (f .absolute () for f in files )
45
+
43
46
for var in variable :
44
47
robot_options_and_args += ("--variable" , var )
45
48
for varfile in variablefile :
@@ -49,17 +52,13 @@ def run_repl(
49
52
if outputdir :
50
53
robot_options_and_args += ("--outputdir" , outputdir )
51
54
52
- root_folder , profile , cmd_options = handle_robot_options (app , robot_options_and_args )
55
+ root_folder , profile , cmd_options = handle_robot_options (app , ( * robot_options_and_args , * ( str ( f ) for f in files )) )
53
56
54
57
try :
55
58
56
- options , arguments = RobotFrameworkEx (
59
+ options , _ = RobotFrameworkEx (
57
60
app ,
58
- (
59
- [* (app .config .default_paths if app .config .default_paths else ())]
60
- if profile .paths is None
61
- else profile .paths if isinstance (profile .paths , list ) else [profile .paths ]
62
- ),
61
+ ["." ],
63
62
app .config .dry ,
64
63
root_folder ,
65
64
).parse_arguments ((* cmd_options , * robot_options_and_args ))
@@ -71,7 +70,7 @@ def run_repl(
71
70
report = None ,
72
71
quiet = True ,
73
72
listener = [
74
- ReplListener (app , Interpreter (app , files = list (paths ), inspect = inspect )),
73
+ ReplListener (app , Interpreter (app , files = list (files ), inspect = inspect )),
75
74
],
76
75
)
77
76
@@ -147,8 +146,8 @@ def run_repl(
147
146
help = "Activate inspection mode. This forces a prompt to appear after the REPL script is executed." ,
148
147
)
149
148
@click .argument (
150
- "paths " ,
151
- type = click .Path (exists = True , path_type = Path ),
149
+ "files " ,
150
+ type = click .Path (exists = True , dir_okay = False , path_type = Path ),
152
151
nargs = - 1 ,
153
152
required = False ,
154
153
)
@@ -160,10 +159,10 @@ def repl(
160
159
pythonpath : Tuple [str , ...],
161
160
outputdir : Optional [str ],
162
161
inspect : bool ,
163
- paths : Tuple [Path , ...],
162
+ files : Tuple [Path , ...],
164
163
) -> None :
165
164
"""\
166
165
Run Robot Framework interactively.
167
166
"""
168
167
169
- run_repl (app , inspect , variable , variablefile , pythonpath , outputdir , paths )
168
+ run_repl (app , inspect , variable , variablefile , pythonpath , outputdir , files )
0 commit comments