diff --git a/src/main/java/net/knarcraft/ffmpegconverter/utility/Parser.java b/src/main/java/net/knarcraft/ffmpegconverter/utility/Parser.java index 93e9321..104aeba 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/utility/Parser.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/utility/Parser.java @@ -56,8 +56,8 @@ public final class Parser { String argumentName = currentToken.substring(2); foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getName().equals(argumentName)); } else if (currentToken.startsWith("-")) { - char argumentShorthand = currentToken.substring(1).charAt(0); - foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getShorthand() == argumentShorthand); + String argumentShorthand = currentToken.substring(1); + foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getShorthand().equals(argumentShorthand)); } else { throw new IllegalArgumentException("Unexpected value when not given an argument."); } diff --git a/src/test/java/net/knarcraft/ffmpegconverter/utility/ParserTest.java b/src/test/java/net/knarcraft/ffmpegconverter/utility/ParserTest.java index ac8c37f..7d23981 100644 --- a/src/test/java/net/knarcraft/ffmpegconverter/utility/ParserTest.java +++ b/src/test/java/net/knarcraft/ffmpegconverter/utility/ParserTest.java @@ -18,9 +18,9 @@ public class ParserTest { @Before public void setUp() { validArguments = new ArrayList<>(); - validArguments.add(new ConverterArgument("anargument", 'a', true, ConverterArgumentValue.STRING)); - validArguments.add(new ConverterArgument("turnoff", 't', false, ConverterArgumentValue.BOOLEAN)); - validArguments.add(new ConverterArgument("turnon", 'o', false, ConverterArgumentValue.BOOLEAN)); + validArguments.add(new ConverterArgument("anargument", "a", true, ConverterArgumentValue.STRING)); + validArguments.add(new ConverterArgument("turnoff", "t", false, ConverterArgumentValue.BOOLEAN)); + validArguments.add(new ConverterArgument("turnon", "o", false, ConverterArgumentValue.BOOLEAN)); } @Test