diff --git a/.changeset/friendly-keys-refuse.md b/.changeset/friendly-keys-refuse.md new file mode 100644 index 0000000000..5cea2523c5 --- /dev/null +++ b/.changeset/friendly-keys-refuse.md @@ -0,0 +1,5 @@ +--- +"@effect/cli": patch +--- + +display a nicer message in the cli wizard when using Option diff --git a/packages/cli/src/internal/options.ts b/packages/cli/src/internal/options.ts index 9cbf642acf..fbbdb559f5 100644 --- a/packages/cli/src/internal/options.ts +++ b/packages/cli/src/internal/options.ts @@ -1431,8 +1431,19 @@ const wizardInternal = (self: Instruction, config: CliConfig.CliConfig): Effect. return InternalSelectPrompt.select({ message: InternalHelpDoc.toAnsiText(message).trimEnd(), choices: [ - { title: `Default ['${JSON.stringify(self.fallback)}']`, value: true }, - { title: "Custom", value: false } + { + title: "Yes", + value: true, + description: `use the default ${ + Option.isOption(self.fallback) + ? Option.match(self.fallback, { + onNone: () => "", + onSome: (a) => `(${JSON.stringify(a)})` + }) + : `(${JSON.stringify(self.fallback)})` + }` + }, + { title: "No", value: false, description: "use a custom value" } ] }).pipe( Effect.zipLeft(Console.log()),