Make commands classes instead of objects (#946)

Making these classes caused native-image to statically initialize
them at build time, which included CLI argument default values
(like working dir).

This turns them back into classes.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
This commit is contained in:
Daniel Chao
2025-02-11 06:38:19 -08:00
committed by GitHub
parent ad99e4a7f7
commit 7ed710c226
13 changed files with 36 additions and 37 deletions

View File

@@ -23,7 +23,8 @@ import org.pkl.commons.cli.CliException
class CliMainTest {
@Test
fun `CLI run test`() {
val e = assertThrows<CliException> { DocCommand.parse(arrayOf("foo", "--output-dir", "/tmp")) }
val e =
assertThrows<CliException> { DocCommand().parse(arrayOf("foo", "--output-dir", "/tmp")) }
assertThat(e)
.hasMessageContaining("must contain at least one module named `doc-package-info.pkl`")
}