Skip to content

Commit

Permalink
Don't allow setting build + passthrough in the flag helper.
Browse files Browse the repository at this point in the history
It masks the warning message and too many people mess this up.
  • Loading branch information
wizjany committed Jun 22, 2019
1 parent 96b6174 commit 6d25513
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -200,7 +200,7 @@ private <V> void appendValueChoices(TextComponent.Builder builder, Flag<V> flag,
if (maySet) {
if (isExplicitSet) {
hoverTexts.add(TextComponent.of("Click to unset", TextColor.GOLD));
} else {
} else if (flag != Flags.BUILD && flag != Flags.PASSTHROUGH) {
hoverTexts.add(TextComponent.of("Click to set", TextColor.GOLD));
}
}
Expand All @@ -221,7 +221,7 @@ private <V> void appendValueChoices(TextComponent.Builder builder, Flag<V> flag,
HoverEvent.of(HoverEvent.Action.SHOW_TEXT, hoverBuilder.build()));
}

if (maySet) {
if (maySet && (isExplicitSet || flag != Flags.BUILD && flag != Flags.PASSTHROUGH)) {
builder.append(choiceComponent.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND,
makeCommand(flag, isExplicitSet ? "" : choice))));
} else {
Expand Down

0 comments on commit 6d25513

Please sign in to comment.