Effect CommunityEC
Effect Community12mo ago
8 replies
RawBean

Default Value Not Displayed in CLI Usage for `Args.withDefault`

I expected Args/Options that have withDefault to print the default value in usage (-h/--help) but that does not seem to be the case.
const foo = Args
  .text({ name: 'foo' })
  .pipe(
    Args.withDefault('bar'),
  );

Yet:
ARGUMENTS

<foo>

  A user-defined piece of text.

  This setting is optional.

I can see in the code that it only prints the default value if the fallback is an Option. Using Args.withDefault(Option.some('bar')) prints the entire Option object though (tag etc.).

Am I misunderstanding something or is this an issue in the CLI package?
Was this page helpful?