Skip to content

Allow for use of \r\n in description without shoving default value to newline #1509

Open
@EricZimmerman

Description

@EricZimmerman

with something like this defined:

 new Option<string>(
                    "--json",
                    "Directory to save json representation to. Use --pretty for a more human readable layout"),
                
new Option<bool>(
    "--pretty",
    getDefaultValue:()=>false,
    "When exporting to json, use a more human readable layout\r\n"),

the output looks like this:

image

it would be nice to define "groups" of options which i have done in the past with other parsers using \r\n, but it seems that when a default value exists, its added after the description.

maybe an extension method for adding the line feed or similar would help, unless there already is an easy way to do this?

another option would be to turn OFF the ability to auto include the default, which then lets me set it directly in the Description (this is how i used to do it).

Activity

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

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonsequitur@EricZimmerman

        Issue actions

          Allow for use of \r\n in description without shoving default value to newline · Issue #1509 · dotnet/command-line-api