Something I should have done a long time ago: attempt to detect whitespace

after the line continuation backslash and enhance the error message if it
appears.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4981 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2011-01-12 23:15:08 +00:00
parent edebbb5aa0
commit 5736d2e2bb
1 changed files with 4 additions and 1 deletions

View File

@ -536,8 +536,11 @@ class UnmatchedArgumentException extends ArgumentException {
private static String formatArguments( ArgumentMatch invalidValues ) {
StringBuilder sb = new StringBuilder();
for( int index: invalidValues.indices.keySet() )
for( String value: invalidValues.indices.get(index) )
for( String value: invalidValues.indices.get(index) ) {
sb.append( String.format("%nInvalid argument value '%s' at position %d.", value, index) );
if(value != null && Utils.dupString(' ',value.length()).equals(value))
sb.append(" Please make sure any line continuation backslashes on your command line are not followed by whitespace.");
}
return sb.toString();
}
}