Skip to content

Commit

Permalink
Fix defaults with flags everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablete1234 committed Nov 19, 2022
1 parent 947364b commit 6305a79
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ private CommandTree(final @NonNull CommandManager<C> commandManager) {
));
}
if (child.getValue() != null) {
if (commandQueue.isEmpty()) {
// Flag arguments need to be skipped over, so that further defaults are handled
if (commandQueue.isEmpty() && !(child.getValue() instanceof FlagArgument)) {
if (child.getValue().hasDefaultValue()) {
commandQueue.add(child.getValue().getDefaultValue());
} else if (!child.getValue().isRequired()) {
Expand Down

0 comments on commit 6305a79

Please sign in to comment.