Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser) No usage for unneeded attached value #4268

Closed

Commits on Sep 27, 2022

  1. fix(parser) No usage for unneeded attached value

    When a value is attached to an option that does not need a value (as in
    "--flag=value"), the error message included a usage line. However, that
    usage line, which could be generic generated usage, "smart" usage based off
    the user-provided command line, or the user-overridden usage. None of these
    forms of usage provide helpful information for this class of error. The
    crux of the problem is explained clearly in the error message's first line.
    
    For example, this:
    
        error: The value 'value' was provided to '--flag' but it wasn't expecting any more values
    
        example --other <path>...
    
        For more information try '--help'
    
    Becomes this:
    
        error: The value 'value' was provided to '--flag' but it wasn't expecting any more values
    
        For more information try '--help'
    
    N.B. a motivating factor is that the "no-title" usage in this error
    message, in addition to being not super useful, was necessarily formatted
    incorrectly with a user-overridden, multi-line usage string. For example:
    
        error: The value 'value' was provided to '--flag' but it wasn't expecting any more values
    
        example -X <path>...
               example -Y [OPTIONS]
               example -Z [OPTIONS] [path]
    
        For more information try '--help'
    
    Removing usage from this error message side-steps the usage formatting
    issue.
    jpgrayson committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    fd913a1 View commit details
    Browse the repository at this point in the history