Skip to content

Commit

Permalink
Update CLI help and add ms to time taken log
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstaeding committed Aug 21, 2023
1 parent 4361ba3 commit 97f05a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/jvmMain/kotlin/org/sourcegrade/jagr/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package org.sourcegrade.jagr

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.help
import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.types.choice
import org.sourcegrade.jagr.launcher.env.Environment
Expand All @@ -42,9 +43,14 @@ class MainCommand : CliktCommand() {
* Command line option to indicate that this process will listen to (via std in) to a grading request
*/
private val child by option("--child", "-c").flag()
.help("Waits to receive grading job details via IPC")
private val noExport by option("--no-export", "-n").flag()
.help("Do not export submission to submissions-export")
private val exportOnly by option("--export-only", "-e").flag()
.help("Do not grade, only export submission to submissions-export")
private val progress by option("--progress").choice("rainbow", "xmas")
.help("Progress bar style")

override fun run() {
if (child) {
Environment.initializeChildProcess()
Expand All @@ -53,7 +59,7 @@ class MainCommand : CliktCommand() {
Environment.initializeMainProcess()
val startTime = System.currentTimeMillis()
StandardGrading(progress).grade(noExport, exportOnly)
Jagr.logger.info("Time taken: ${System.currentTimeMillis() - startTime}")
Jagr.logger.info("Time taken: ${System.currentTimeMillis() - startTime}ms")
}
}
}

0 comments on commit 97f05a6

Please sign in to comment.