Skip to content

Commit

Permalink
Report options with BoolOrEnumConverter as supporting --no...
Browse files Browse the repository at this point in the history
Fixes #24882

Closes #24883.

PiperOrigin-RevId: 714854122
Change-Id: I5e48e84f88606320223a9969e8367924aeeb13dd
  • Loading branch information
fmeum authored and bazel-io committed Jan 13, 2025
1 parent 95e54f6 commit 6a4a807
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private static void emitFlagsAsProtoHelp(BlazeRuntime runtime, OutErr outErr) {
private static BazelFlagsProto.FlagInfo.Builder createFlagInfo(OptionDefinition option) {
BazelFlagsProto.FlagInfo.Builder flagBuilder = BazelFlagsProto.FlagInfo.newBuilder();
flagBuilder.setName(option.getOptionName());
flagBuilder.setHasNegativeFlag(option.hasNegativeOption());
flagBuilder.setHasNegativeFlag(option.usesBooleanValueSyntax());
flagBuilder.setDocumentation(option.getHelpText());
flagBuilder.setAllowsMultiple(option.allowsMultiple());
flagBuilder.setRequiresValue(option.requiresValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ public boolean getOldNameWarning() {
return optionAnnotation.oldNameWarning();
}

/** Returns whether an option --foo has a negative equivalent --nofoo. */
public boolean hasNegativeOption() {
return getType().equals(boolean.class) || getType().equals(TriState.class);
}

/** The type of the optionDefinition. */
public Class<?> getType() {
return field.getType();
Expand Down

0 comments on commit 6a4a807

Please sign in to comment.