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 copybara-github committed Jan 13, 2025
1 parent 5fb222f commit 6423b04
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 @@ -271,7 +271,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 @@ -124,11 +124,6 @@ public boolean getBooleanValue(OptionsBase optionsBase) {
/** Returns a warning to use with this option if the old name is specified. */
public abstract boolean getOldNameWarning();

/** 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 abstract Class<?> getType();

Expand Down

0 comments on commit 6423b04

Please sign in to comment.