X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Futil%2FCommandLineArguments.java;h=31a50c9ee75b69fa4e0b5aff6f74834775d8a234;hb=7713a9bc5abcc18bcfeb3b8e4d172edef36b0992;hp=0fc0485b750b34aa780be5f7016ae007d18c3792;hpb=48f7a89be9d34f1930a1f863e608235cc27184c5;p=jalview.git diff --git a/forester/java/src/org/forester/util/CommandLineArguments.java b/forester/java/src/org/forester/util/CommandLineArguments.java index 0fc0485..31a50c9 100644 --- a/forester/java/src/org/forester/util/CommandLineArguments.java +++ b/forester/java/src/org/forester/util/CommandLineArguments.java @@ -5,7 +5,7 @@ // Copyright (C) 2008-2009 Christian M. Zmasek // Copyright (C) 2008-2009 Burnham Institute for Medical Research // All rights reserved -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -15,13 +15,13 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. -// +// // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.util; @@ -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 { @@ -182,7 +186,7 @@ public final class CommandLineArguments { for( int i = 0; i < args.length; ++i ) { final String arg = args[ i ].trim(); _command_line_str += arg; - if ( i < args.length - 1 ) { + if ( i < ( args.length - 1 ) ) { _command_line_str += " "; } if ( arg.startsWith( CommandLineArguments.EXTENDED_OPTIONS_PREFIX ) ) {