summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhelllth <th@cismet.de>2014-07-22 13:41:46 +0200
committerhelllth <th@cismet.de>2014-07-22 13:41:46 +0200
commit55e9949641d8906e622ea92f40ac1138ae74a30c (patch)
tree1750046bb10dcefd32fe8c050df60ceeb5ba0115
parent649895bc27f8b294e596727a88d765d923be2226 (diff)
downloadjcommander-55e9949641d8906e622ea92f40ac1138ae74a30c.tar.gz
add the possibility to have # comments in a @file
-rw-r--r--src/main/java/com/beust/jcommander/JCommander.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/beust/jcommander/JCommander.java b/src/main/java/com/beust/jcommander/JCommander.java
index 3884976..f4a29e5 100644
--- a/src/main/java/com/beust/jcommander/JCommander.java
+++ b/src/main/java/com/beust/jcommander/JCommander.java
@@ -485,8 +485,10 @@ public class JCommander {
// Read through file one line at time. Print line # and line
while ((line = bufRead.readLine()) != null) {
- // Allow empty lines in these at files
- if (line.length() > 0) result.add(line);
+ // Allow empty lines and # comments in these at files
+ if (line.length() > 0 && ! line.trim().startsWith("#")) {
+ result.add(line);
+ }
}
bufRead.close();