Skip to content

Commit

Permalink
Added org names to specifically pick the args to and make reordering …
Browse files Browse the repository at this point in the history
…possible
  • Loading branch information
Rd4dev committed Jun 28, 2024
1 parent e65f497 commit 16eaf33
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ import java.util.concurrent.TimeUnit
fun main(vararg args: String) {
val repoRoot = args[0]
val filePath = args[1]
val format = args.getOrNull(2)
val reportFormat = when {
format.equals("HTML", ignoreCase = true) -> ReportFormat.HTML
format.equals("MARKDOWN", ignoreCase = true) || format == null -> ReportFormat.MARKDOWN
format.startsWith("processTimeout=") -> ReportFormat.MARKDOWN

val format = args.find { it.startsWith("format=", ignoreCase = true) }
?.substringAfter("=")
?.uppercase() ?: "MARKDOWN"

val reportFormat = when (format) {
"HTML" -> ReportFormat.HTML
"MARKDOWN" -> ReportFormat.MARKDOWN
else -> throw IllegalArgumentException("Unsupported report format: $format")
}

Expand Down

0 comments on commit 16eaf33

Please sign in to comment.