Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce separate clikt-core module that has no dependencies #516

Merged
merged 20 commits into from
May 18, 2024

Conversation

ajalt
Copy link
Owner

@ajalt ajalt commented May 17, 2024

This PR splits the code into two modules: clikt-core which contains most of the code and has zero dependencies, and clikt-mordant which depends on mordant and clikt-core and contains only the code that requires mordant.

The command type heirarcy is now BaseCliktCommand (no run function or mordant) -> CoreCliktCommand (no mordant) -> CliktCommand (all features).

Some new Context configuration porperties like exitProcess were added to allow plugging in mordant, and custom command types can call Context.installMordant() to set them all up at once.

Fortunately, the MordantHelpFormatter was already pretty customizable, so I was able to extract most of it to a base class and create a new PlaintextHelpFormatter without much extra code.

The maven coordinates for clikt-mordant are still com.github.ajalt.clikt:clikt, so the default feature set doesn't change.

Fixes #507
Fixes #454

@ajalt ajalt marked this pull request as ready for review May 17, 2024 17:54
@ajalt ajalt merged commit 56ce1c5 into master May 18, 2024
4 checks passed
@ajalt ajalt deleted the core-module branch May 18, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clikt 4.X grew in jar size to over 8mb
1 participant