Allow command transformAll functions to perform imports (#1440)

This commit is contained in:
Jen Basch
2026-02-25 08:03:53 -08:00
committed by GitHub
parent 2e4d73b957
commit be21c34938
7 changed files with 91 additions and 19 deletions

View File

@@ -176,6 +176,10 @@ class Flag extends BaseFlag {
/// Customize the behavior of turning all parsed flag values into the final option value.
///
/// When the return value is an [Import] value or a [Pair] member, [List] or [Set] element
/// containing an [Import], the URI or glob URI specified by the value is imported and the value
/// is replaced with the value of the imported module(s).
///
/// If no value is provided, all flag values are transformed according to the option's type:
///
/// | Type | Behavior |
@@ -235,6 +239,10 @@ class Argument extends Annotation {
/// Customize the behavior of turning all parsed flag values into the final option value.
///
/// When the return value is an [Import] value or a [Pair] member, [List] or [Set] element
/// containing an [Import], the URI or glob URI specified by the value is imported and the value
/// is replaced with the value of the imported module(s).
///
/// If no value is provided, all option values are transformed using the same rules as
/// [Flag.transformAll].
transformAll: ((List<Any>) -> Any)?