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

fixes behavior of --no-* options #795

Merged
merged 1 commit into from Jun 27, 2019

Commits on Jun 24, 2019

  1. fixes behavior of --no-* options

    A bug existed whenever a "--no"-prefixed option was defined along with
    its counterpart (e.g. "--status" and "--no-status"), which caused the
    corresponding boolean attribute to always be `false` when either option
    was specified on the command line.
    
    This was because the definition of a negating option would overwrite the
    default value of the attribute, combined with the fact that specifying either
    option would emit two events with conflicting logic.
    
    This has been corrected in two ways:
    1. During the setup of a negating option, we now check to see if the
       non-negated counterpart was already defined, in which case we don't
       set/overwrite the default value (which would be "true");
    2. An option's name no longer omits its negation prefix; that is,
       "--no-cheese" is internally "no-cheese", which will distinguish it
       from "--cheese"—this will allow unique events to be registered and
       emitted, depending on which option is passed to the command, thus
       avoiding any attribute assignment collision.
    
    Additionally, tests for negated options were added/updated to more
    explicitly demonstrate the expected behavior, and a couple of relevant
    examples were fixed to match their intended behavior.
    usmonster committed Jun 24, 2019
    Copy the full SHA
    26594fb View commit details
    Browse the repository at this point in the history