ajalt / clikt

Multiplatform command line interface parsing for Kotlin
https://ajalt.github.io/clikt/
Apache License 2.0
2.56k stars 123 forks source link

Excessive Mordant dependencies by default on JVM #559

Closed mikaelstaldal closed 1 month ago

mikaelstaldal commented 1 month ago

When depending on Clikt on JVM, you get not only Mordant core, but also all three different Mordant implementations on your classpath:

What about depending only on mordant-core by default? I guess that should be enough for basic functionality of Clikt.

ajalt commented 1 month ago

A lot of mordant's functionality on JVM requires one of those modules. You can exclude the jvm modules through gradle, though, and it will still compile.

mikaelstaldal commented 1 month ago

But does Clikt's functionality require one of those modules? If you only use Clikt and not Mordant directly (only indirectly through Clikt).

ajalt commented 1 month ago

The only parts of the JVM modules that Clikt uses are for terminal detection. Without them, it won't be able to detect the terminal size, so words will always wrap at 79 columns, and it won't be able to detect if the terminal is interactive, so if you redirect output to a file, it will print ANSI codes to the file instead of plaintext.

mikaelstaldal commented 1 month ago

Ah, OK. Good to know.

If you don't want this, you are supposed to use clikt-core?

ajalt commented 1 month ago

That's another option, although clikt-core has even more limited functionality