Skip to content

Make it easier to decide usage line length late #55

Open

Description

@natebosch

We allow passing a usageLineLength to ArgParser or CommandRunner in the constructor. In both cases the field is final and is read internally by the usage getter. This means that the wrapping needs to be decided before the arguments are parsed, so parsed arguments can't be used to inform the line length.

The most immediate option I can think of is to change usageLineLength from a final field to a settable field, and then the option that controls wrapping would pass a callback that sets the field on the parser.

Activity

  1. munificent commented on Aug 25, 2020

    @munificent
    Member

    I've run into other issues with how eager ArgParser and CommandRunner is about pinning things down. In particular, it is surprisingly hard to gracefully handle help options that only show up when --verbose is passed. At some point, we may want to consider a more just-in-time API for generating help/usage information that takes a few parameters instead of having to bake everything when you create the ArgParser.

  2. transferred this issue fromdart-archive/argson Oct 14, 2024
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

      Issue actions