From 4cdfa58b27d790786cbb2f17aa8f4635ea9d5a2d Mon Sep 17 00:00:00 2001 From: isxander Date: Sat, 18 Nov 2023 09:43:58 +0000 Subject: Set the pending value before creating the controller --- common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java | 5 +++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java index 37a626b..e539f73 100644 --- a/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java +++ b/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java @@ -45,11 +45,12 @@ public final class OptionImpl implements Option { this.available = available; this.flags = flags; this.listeners = new ArrayList<>(listeners); + + this.pendingValue = binding.getValue(); this.controller = controlGetter.apply(this); addListener((opt, pending) -> description = descriptionFunction.apply(pending)); - - requestSet(binding().getValue()); + triggerListeners(true); } @Override diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9ec0ca6..f48a8c4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Apr 23 19:05:18 BST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -- cgit