forked from juice-ryang/online-judge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
terminal_capsule.py
28 lines (24 loc) · 884 Bytes
/
terminal_capsule.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from OnlineJudgeServer.terminal_capsule import _Registered
if __name__ == "__main__":
from click import (
argument,
command,
option,
Choice,
File,
Path,
)
@command()
@argument('program', type=Path())
@option('-m', '--mode',
'mode', type=Choice(_Registered.keys()), default='capture')
@option('-j', '--json', type=Path(), default=None,
help='Generate .json (or playback/validate)')
@option('-o', '--out', type=File('wb'), default=None,
help='Generate .out (or logging)')
@option('-t', '--timeout', type=int, default=None,
help='Set timeout (default: .05s, validate: 2.5s)')
def __main__(program, mode, json, out, timeout):
"""Entrypoint for Terminal Capsule."""
_Registered[mode](program, json, out, timeout=timeout)
__main__()