@jutge.org/toolkit 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +242 -242
- package/package.json +1 -1
- package/toolkit/submit.ts +6 -2
package/package.json
CHANGED
package/toolkit/submit.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Command } from '@commander-js/extra-typings'
|
|
2
2
|
import { submitInDirectory } from '../lib/submit'
|
|
3
|
+
import { nanoid16 } from '../lib/utils'
|
|
3
4
|
|
|
4
5
|
export const submitCmd = new Command('submit')
|
|
5
6
|
.summary('Submit solutions to Jutge.org')
|
|
6
7
|
|
|
7
8
|
.argument('<programs...>', 'programs to submit (e.g. solution.cc slow.py buggy.py)')
|
|
8
9
|
.option('-d, --directory <directory>', 'problem directory', '.')
|
|
10
|
+
.option('-c, --compiler <id>', 'compiler to use (default: auto-detect from file extension)', 'auto')
|
|
9
11
|
.option('-l, --language <code>', 'language code (ca, es, en, ...)', 'en')
|
|
10
12
|
.option('-n, --no-wait', 'do not wait for submissions to be judged')
|
|
13
|
+
.option('-a, --annotation <annotation>', "annotation for the submission (default: 'jtk-submit-<nanoid16>')")
|
|
11
14
|
|
|
12
|
-
.action(async (programs, { directory, language, wait }) => {
|
|
13
|
-
|
|
15
|
+
.action(async (programs, { directory, compiler, language, wait, annotation }) => {
|
|
16
|
+
const annotationValue = annotation ?? `jtk-submit-${nanoid16()}`
|
|
17
|
+
await submitInDirectory(directory, language, programs, !wait, compiler, annotationValue)
|
|
14
18
|
})
|