Skip to content

Feature request: smarter parsing of doc comments #134

Closed

Description

@Lucretiel

If I have a docopt like this:

#[structopt(short="n", long="no-op")]
/// Run the command as normal, but don't modify the file
///
/// In no-op mode, rewrite will do everything it normally does, including
/// writing to a temporary file, if enabled. The only thing it doesn't do is
/// modify the contents of the file.
no_op: bool,

It would be nice if structopt detected the line break, and set the separate parts as help and long_help. It would also be nice if it automatically reflows the line breaks correctly.

Activity

  1. added
    enhancement
    breaking-change
    on Aug 26, 2018
  2. TeXitoi commented on Aug 26, 2018

    @TeXitoi
    Owner

    Good idea, but it will be a breaking change.

    Structopt already merge lines, thus, clap should reflow. If not, that a problem with clap.

  3. 0ndorio commented on Oct 11, 2018

    @0ndorio
    Contributor

    Would it be possible to come up a new feature flag (e.g. split_doc_comment, upcoming_enhancement) to introduce such a new feature earlier as an explicit opt-in?

  4. TeXitoi commented on Oct 11, 2018

    @TeXitoi
    Owner

    That's not a problem of doing a breaking change, we just release a 0.3 and that's it. It will force me to do the other breaking changes that I want (I think of #18).

  5. 0ndorio commented on Oct 12, 2018

    @0ndorio
    Contributor

    Structopt already merge lines, thus, clap should reflow. If not, that a problem with clap.

    Maybe somthing completly differnt but as it fits the smarter doc comment parsing section. Is there any option forcing structopt to keep the formatting of the doc comment to achieve the same behaviour as using a raw string for long_help or long_about?

    This could be nice as it would allow to introduce proper formatted doc comments including lists and source blocks into the long descriptions.

  6. ebkalderon commented on Feb 12, 2019

    @ebkalderon

    Since #146 was already merged and published, shouldn't this issue be closed?

  7. TeXitoi commented on Feb 12, 2019

    @TeXitoi
    Owner

    @ebkalderon good point

    @0ndorio if you still want #134 (comment) please create a dedicated issue.

  8. Lucretiel commented on Feb 12, 2019

    @Lucretiel
    Author

    Thanks!

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

    breaking-changeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions