Skip to content

Commit

Permalink
[7.5.0] Report options with BoolOrEnumConverter as supporting `--no…
Browse files Browse the repository at this point in the history
…...` (#24908)

Fixes #24882

Closes #24883.

PiperOrigin-RevId: 714854122
Change-Id: I5e48e84f88606320223a9969e8367924aeeb13dd

Commit
6423b04

Co-authored-by: Fabian Meumertzheim <[email protected]>
  • Loading branch information
bazel-io and fmeum authored Jan 13, 2025
1 parent 708db87 commit bf204b6
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 bf204b6

Please sign in to comment.