diff --git a/plugins/commands/compare/src/main/kotlin/CompareCommand.kt b/plugins/commands/compare/src/main/kotlin/CompareCommand.kt index f1559ccd04329..ea4919ff60edd 100644 --- a/plugins/commands/compare/src/main/kotlin/CompareCommand.kt +++ b/plugins/commands/compare/src/main/kotlin/CompareCommand.kt @@ -34,6 +34,7 @@ import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.enum import com.github.ajalt.clikt.parameters.types.file +import com.github.ajalt.clikt.parameters.types.int import com.github.ajalt.mordant.rendering.Theme import com.github.difflib.DiffUtils import com.github.difflib.UnifiedDiffUtils @@ -70,6 +71,12 @@ class CompareCommand : OrtCommand( ).enum() .default(CompareMethod.TEXT_DIFF) + private val contextSize by option( + "--context-size", "-s", + help = "The context size to use for the unified diff." + ).int() + .default(7) + private val ignoreTime by option( "--ignore-time", "-t", help = "Ignore time differences." @@ -148,7 +155,7 @@ class CompareCommand : OrtCommand( "b/${fileB.relativeTo(commonParent).invariantSeparatorsPath}", linesA, DiffUtils.diff(linesA, linesB), - /* contextSize = */ 7 + contextSize ) if (diff.isEmpty()) {