diff options
author | eea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-24 23:13:22 +0000 |
---|---|---|
committer | eea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-24 23:13:22 +0000 |
commit | 8bd3483e15b78016dde514251b613090b8eadeb3 (patch) | |
tree | 092aa5e7a0557df22b2a01b21fa7a8cdbcba217c /java | |
parent | 285a1a88b480f4fdd6758defe3f5200360f60483 (diff) | |
download | ATCD-8bd3483e15b78016dde514251b613090b8eadeb3.tar.gz |
Updated source files for tests/Misc.
Diffstat (limited to 'java')
-rw-r--r-- | java/JACE/tests/Misc/ParseArgsTest.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/java/JACE/tests/Misc/ParseArgsTest.java b/java/JACE/tests/Misc/ParseArgsTest.java new file mode 100644 index 00000000000..cc27b28d75b --- /dev/null +++ b/java/JACE/tests/Misc/ParseArgsTest.java @@ -0,0 +1,48 @@ +// ============================================================================ +// +// = PACKAGE +// tests.Misc +// +// = FILENAME +// ParseArgsTest.java +// +// = AUTHOR +// Prashant Jain +// +// ============================================================================ +package JACE.tests.Misc; + +import JACE.OS.*; +import JACE.Misc.*; + +public class ParseArgsTest +{ + public static void main (String args[]) + { + ACE.enableDebugging (); + + String s; + GetOpt opt = new GetOpt (args, "p:rs:", true); + for (int c; (c = opt.next ()) != -1; ) + { + System.out.println ("c is " + (char)c); + switch (c) + { + case 'p': + s = opt.optarg (); + ACE.DEBUG ("Option <p> selected with argument " + s); + break; + case 'r': + ACE.DEBUG ("Option <r> selected"); + break; + case 's': + s = opt.optarg (); + ACE.DEBUG ("Option <s> selected with argument " + s); + break; + default: + ACE.DEBUG ("Usage: java tests.Misc.ParseArgsTest [-p arg1] [-r] [-s arg2]"); + break; + } + } + } +} |