28
28
default = "custom" ,
29
29
help = "Use a validator. You can also use the validator provided by testlib in a similar way as the checker." ,
30
30
)
31
- def init (problem , language , checker , validator ):
31
+ @click .option ("--testcase" , type = int , default = 20 , help = "The number of testcases." )
32
+ @click .option (
33
+ "--time-limit" ,
34
+ type = int ,
35
+ default = 1000 ,
36
+ help = "The time limit of the problem, uses ms as unit." ,
37
+ )
38
+ @click .option (
39
+ "--memory-limit" ,
40
+ type = int ,
41
+ default = 512 ,
42
+ help = "The memory limit of the problem, uses MB as unit." ,
43
+ )
44
+ def init (problem , language , checker , validator , testcase , time_limit , memory_limit ):
32
45
"""This command initializes a lynx problem directory."""
33
46
# Turn the problem path into an absolute path
34
47
if not os .path .isabs (problem ):
@@ -37,4 +50,8 @@ def init(problem, language, checker, validator):
37
50
if os .path .exists (problem ):
38
51
error_and_exit (f"Problem directory { problem } already exists." )
39
52
if language in CPP_STANDARDS :
40
- cpp .init_problem (problem , language , checker , validator )
53
+ cpp .init_problem (
54
+ problem , language , checker , validator , testcase , time_limit , memory_limit
55
+ )
56
+ else : # Other languages will be supported in the future
57
+ assert False # This should never happen
0 commit comments