Skip to content

--help and --version are silent #4166

Open

Description

@jonasfj
  if (optionRoot['help'].valueAtCurrent() as bool) {
    logInfo('dartdoc version: $dartdocVersion');
    logInfo('Generate HTML documentation for Dart libraries.\n');
    logInfo(optionRoot.argParser.usage);
    exitCode = 0;
    return null;
  }
  if (optionRoot['version'].valueAtCurrent() as bool) {
    logInfo('dartdoc version: $dartdocVersion');
    exitCode = 0;
    return null;
  }

It seems to me that logInfo doesn't print things. Maybe we should use print instead, or maybe the default log-level changed accidentally.

Activity

  1. jonasfj commented on Jan 12, 2026

    @jonasfj
    MemberAuthor

    When globally activated from pub.dev

  2. sigurdm commented on Jan 22, 2026

    @sigurdm
    Contributor

    I can reproduce.

  3. sigurdm commented on Jan 22, 2026

    @sigurdm
    Contributor

    This is a problem with the bin/dartdoc.dart runner (not if you run dart doc)

  4. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Jan 22, 2026
  5. srawlins commented on Jan 22, 2026

    @srawlins
    Member

    Hmm yeah in dartdoc_options.dart, we call logInfo if 'help' or 'version' is passed, but that's outside the Dartdoc.executeGuarded closure, so maybe they should just print...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions