Skip to content

Show [default: boolean] in --help command #2818

Open

Description

@poasungoh

System.CommandLine v2.0.6 removed the support for showing [default:boolean] in --help command.

If we set our option default value as "True" or "False", it will not be showing when we enter --help.

Example: v2.0.6

Options:
--IsConnected (REQUIRED) Indicate connection need to be connected (boolean).

Expected:

Options:
--IsConnected (REQUIRED) Indicate connection need to be connected (boolean). [Default: True]

In previous version, it will show True if we set default value as True. Or show False, if we set default value as False

Activity

  1. hiSandog commented on Jul 11, 2026

    @hiSandog

    The example marks the option as required while also assigning a default, which are contradictory contracts and may explain why help suppresses the value. A regression should separate optional bool-with-default, required bool, flag-style bool, and a custom default-value factory, then assert help reflects only defaults that can actually be used. If dynamic defaults cannot be evaluated safely during help generation, the formatter should expose a documented description hook rather than silently claiming a static value.

  2. RushuiGuan commented on Jul 13, 2026

    @RushuiGuan

    It has been fixed in v3.0.0-preview.5.26302.115.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions