-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terminal Capsule Pull Out and clean up
- Loading branch information
1 parent
0673b6c
commit ec498a3
Showing
3 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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__() |