summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Beust <cedric@beust.com>2015-01-14 15:45:07 -0800
committerCedric Beust <cedric@beust.com>2015-01-14 15:45:07 -0800
commitbb73fda634685379a8e99565f42b0ad47ac9bace (patch)
treee16184a7a1ecc8f7b92741ea05383e7f74efd2e0
parent7df4020c040d83c827b1238cea6c2688b6763570 (diff)
downloadjcommander-bb73fda634685379a8e99565f42b0ad47ac9bace.tar.gz
Doc update.
-rw-r--r--doc/index.html20
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/index.html b/doc/index.html
index 8ee8880..6d67768 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -52,7 +52,7 @@
</tr>
<tr>
<td align="right">
- Last updated: August 2nd, 2014
+ Last updated: January 14th, 2015
</td>
</tr>
<tr><td align="right"><a href="mailto:cedric@beust.com">C&eacute;dric Beust</a></td></tr>
@@ -808,9 +808,25 @@ object Main {
}
</pre>
+<h2><a class="section" name="Groovy">JCommander in Groovy</a></h2>
+
+<pre class="brush: java">
+import com.beust.jcommander.*
+
+class Args {
+ @Parameter(names = ["-f", "--file"], description = "File to load. Can be specified multiple times.")
+ List&lt;String&gt; file
+}
+
+new Args().with {
+ new JCommander(it, args)
+ file.each { println "file: ${new File(it).name}" }
+}
+</pre>
+
<h2><a class="section" name="More_examples">More examples</a></h2>
-TestNG uses JCommander to parse its command line, here is <a href="http://github.com/cbeust/testng/blob/master/src/main/java/org/testng/CommandLineArgs.java">its definition file</a>.
+TestNG uses JCommander to parse its own command line, here is <a href="http://github.com/cbeust/testng/blob/master/src/main/java/org/testng/CommandLineArgs.java">its definition file</a>.
<h2><a class="section" name="Mailing_list">Mailing list</a></h2>