diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-06-27 12:01:58 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-06-27 12:01:58 +0200 |
commit | 5793b6bb9adb54a83229da47a1fa59500b57c396 (patch) | |
tree | b1075b9edf8e37af89efa1861fd1f2fcc8f356eb /src/ArgParser.java | |
parent | add options to java test (diff) | |
download | argparser-5793b6bb9adb54a83229da47a1fa59500b57c396.tar.gz argparser-5793b6bb9adb54a83229da47a1fa59500b57c396.tar.bz2 argparser-5793b6bb9adb54a83229da47a1fa59500b57c396.tar.xz |
message should be null if there are no message arguments
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/ArgParser.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ArgParser.java b/src/ArgParser.java index c063b37..6611b04 100644 --- a/src/ArgParser.java +++ b/src/ArgParser.java @@ -1042,14 +1042,16 @@ public class ArgParser break; } } - final StringBuilder sb = new StringBuilder(); - for (final String file : this.files) - { sb.append(' '); - sb.append(file); + if (this.files.size() > 0) + { final StringBuilder sb = new StringBuilder(); + for (final String file : this.files) + { sb.append(' '); + sb.append(file); + } + this.message = sb.toString(); + if (this.message.length() > 0) + this.message = this.message.substring(1); } - this.message = sb.toString(); - if (this.message.length() > 0) - this.message = this.message.substring(1); if (this.unrecognisedCount > 5) { int more = this.unrecognisedCount - 5; |