X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Futil%2FCommandLineArguments.java;h=efbce625d8e61aab12e37c8cc11b1473235279fd;hb=5c4dc1fb4a38c45f03ef67541592bac5113a2a6f;hp=7e2a167710c619ccbb96e20e9c73b79232f0156f;hpb=656be28debec520e0e35a8b311114398a40ea366;p=jalview.git diff --git a/forester/java/src/org/forester/util/CommandLineArguments.java b/forester/java/src/org/forester/util/CommandLineArguments.java index 7e2a167..efbce62 100644 --- a/forester/java/src/org/forester/util/CommandLineArguments.java +++ b/forester/java/src/org/forester/util/CommandLineArguments.java @@ -93,7 +93,7 @@ public final class CommandLineArguments { if ( o.containsKey( option_name ) ) { final String value = o.get( option_name ); if ( !ForesterUtil.isEmpty( value ) ) { - return value; + return value.replaceAll( "\\s+", " " ).trim(); } else { throw new IllegalArgumentException( "value for \"" + option_name + "\" is not set" ); @@ -112,6 +112,10 @@ public final class CommandLineArguments { return getOptionValue( option_name ).replaceAll( "\"", "" ).replaceAll( "\'", "" ); } + public char getOptionValueAsChar( final String option_name ) throws IllegalArgumentException { + return getOptionValue( option_name ).charAt( 0 ); + } + public double getOptionValueAsDouble( final String option_name ) throws IOException { double d = -Double.MAX_VALUE; try {