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

Improve support for recursive lazy paraemeters #474

Closed ajalt closed 11 months ago

ajalt commented 11 months ago

Allow lazy options and arguments to reference parameters from groups, and allow unlimited recursion.

The way we support parameters referencing other parameters is by collecting any parameters that failed to finalize and finalizing them again after all other parameters have succeeded.

Prior to this PR, we finalized options, groups, and arguments in separate passes. These passes were interleaved and carefully ordered to work correctly.

This PR does away with the manual pass ordering and instead finalizes all parameters repeatedly, iterating until a fixed point is reached.

Fixes #473