Skip to content

Help - line wrap #833

Closed
Closed

Description

@drmcghee

In my code I have a multiple line summary (comments) for my main method.

when I run my executable and ask for help myapp.exe --help the summary gets line wrapped.
I would like for each line in my summary to have a new line between.

I have tried every mechanism to make this work to no joy (also looked in the dragonfruit code a little) but couldn't find a quick fix.

 /// <summary>
 /// line 1
 /// line2
 /// </summary>

Activity

  1. added
    bug
    good first issue
    on Mar 30, 2020
  2. marcusturewicz commented on May 25, 2020

    @marcusturewicz
    Contributor

    Unless I'm missing something, but it's not as simple as that. You might have a summary that spans multiple lines (for code readability) but you really want the newlines removed in the help description, e.g.:

    /// <summary>
    /// This is a really long summary because my app is really great and I want
    /// to say lots of great things about it in this summary so people will use it
    /// all the time and then I will get famous.
    /// </Summary>

    So how do you to tell DragonFruit that it should keep the newline? You could use a special character e.g. -:

    /// <summary>
    /// - This is a really great app
    /// - You can use it for all the things
    /// </Summary>

    But then you should support multiple levels of indentation, bullet points and so forth? Is this really worth it? For instance, node -h and npm -h don't have a description and dotnet -h has a super small description : Execute a .NET SDK command.

  3. drmcghee commented on Jun 4, 2020

    @drmcghee
    Author

    I don't think it needs to be complicated. just look for a newline? I don't think there is any need for detailed formatting in comments but I do see the need for line returns

  4. marcusturewicz commented on Jun 4, 2020

    @marcusturewicz
    Contributor

    But the newline won't work in every case - if you have a long Summary and have used newlines for code readability, you want these removed in the help command.

  5. asasine commented on Nov 5, 2020

    @asasine
    Contributor

    .NET XML documentation supports the <para> tag for explicitly specifying paragraphs. When it is compiled, separate paragraphs are separated by line breaks.

    https://docs.microsoft.com/dotnet/csharp/programming-guide/xmldoc/para

  6. yringler commented on Nov 10, 2020

    @yringler

    tags do not create newlines in --help from dragon fruit. That would be great if they did!

  7. yringler commented on Nov 10, 2020

    @yringler

    I ran the test, and saw that if there was only one para tag it did create the new line? But multiple it didn't, because it uses Value?
    I don't have time to look into this further, but I did open a PR (only to my forks master, I don't want to clutter up the offical repo with a PR if I don't intend on following up), and anyone can feel free to take a look and base further work in this area on that.

    I do think proper handling of doc string tags (list, para, etc) would help create nice help messages, which are nice to have.
    yringler/pull/1/

  8. josephbateh commented on Jan 29, 2022

    @josephbateh
    Contributor

    Hey folks, I have a local branch that iterates on @yringler's changes and updates the test to go with it. I'm unable to push the branch to create a PR though:

    ERROR: Permission to dotnet/command-line-api.git denied to josephbateh.
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    I checked the Contributing doc and I don't see a way to request access. Is there a process to request access to push branches to the repo and create pull requests?

  9. baronfel commented on Jan 29, 2022

    @baronfel
    Member

    Typically you'd fork this repository, make your changes on a branch of your fork, and then send a pull request from your fork's branch to this repository.

  10. josephbateh commented on Jan 29, 2022

    @josephbateh
    Contributor

    Thanks @baronfel, followed that and created a PR: link. Hopefully I'm following the process properly, not sure if I'm supposed to link the PR to the issue.

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

    Area-DragonFruitArea-Helpbuggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions