Skip to content

Commit

Permalink
Outsource default argument type to argparse4j
Browse files Browse the repository at this point in the history
  • Loading branch information
qtc-de committed Jan 1, 2024
1 parent 1b943d4 commit aca6a1f
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/eu/tneitzel/rmg/internal/RMGOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import eu.tneitzel.argparse4j.global.modifiers.NArgs;
import eu.tneitzel.argparse4j.global.modifiers.Type;
import eu.tneitzel.argparse4j.impl.Arguments;
import eu.tneitzel.argparse4j.impl.action.StoreTrueArgumentAction;
import eu.tneitzel.argparse4j.inf.ArgumentAction;

/**
Expand Down Expand Up @@ -623,24 +622,7 @@ public enum RMGOption implements IOption
*/
RMGOption(String name, String description, ArgumentAction argumentAction, IOptionGroup optionGroup)
{
this.name = name;
this.description = description;
this.argumentAction = argumentAction;
this.optionGroup = optionGroup;

if (argumentAction instanceof StoreTrueArgumentAction)
{
this.modifiers = new IArgumentModifier[] {
new Type(Boolean.class)
};
}

else
{
this.modifiers = new IArgumentModifier[] {
new Type(String.class)
};
}
this(name, description, argumentAction, optionGroup, new IArgumentModifier[] {});
}

/**
Expand Down

0 comments on commit aca6a1f

Please sign in to comment.