diff options
author | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-12 00:53:03 +0000 |
---|---|---|
committer | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-12 00:53:03 +0000 |
commit | d34b1eeafa3fa94370d9daea349b13b3f1d2046f (patch) | |
tree | 89af770048cabc399c0d028e6dabcf43defd3170 /java/tests/Misc | |
parent | e8d6c3f71e9fc8d3d58e7d0e7cacbdd5c9737753 (diff) | |
download | ATCD-d34b1eeafa3fa94370d9daea349b13b3f1d2046f.tar.gz |
image files
test files
source files
Diffstat (limited to 'java/tests/Misc')
-rw-r--r-- | java/tests/Misc/Makefile | 21 | ||||
-rw-r--r-- | java/tests/Misc/ParseArgsTest.java | 45 |
2 files changed, 66 insertions, 0 deletions
diff --git a/java/tests/Misc/Makefile b/java/tests/Misc/Makefile new file mode 100644 index 00000000000..2ea3d10fba5 --- /dev/null +++ b/java/tests/Misc/Makefile @@ -0,0 +1,21 @@ +# Makefile + +.SUFFIXES: .java .class + +JACE_WRAPPER = ../.. +CLASSDIR = $(JACE_WRAPPER)/classes + +CLASSPATH := $(CLASSDIR):$(CLASSPATH) + +all: + javac -d ${JACE_WRAPPER}/classes $(files) +doc: + javadoc -d ${JACE_WRAPPER}/doc $(files) $(packages) + + +files = ParseArgsTest.java + +packages = tests.Misc + +realclean: + find ${JACE_WRAPPER}/classes/tests/Misc -name '*.class' -print | xargs ${RM} diff --git a/java/tests/Misc/ParseArgsTest.java b/java/tests/Misc/ParseArgsTest.java new file mode 100644 index 00000000000..f2976ddcb11 --- /dev/null +++ b/java/tests/Misc/ParseArgsTest.java @@ -0,0 +1,45 @@ +// ============================================================================ +// +// = PACKAGE +// tests.Misc +// +// = FILENAME +// ParseArgsTest.java +// +// = AUTHOR +// Prashant Jain +// +// ============================================================================ +package tests.Misc; + +import ACE.OS.*; +import ACE.Misc.*; + +public class ParseArgsTest +{ + public static void main (String args[]) + { + String s; + GetOpt opt = new GetOpt (args, "p:rs:"); + for (int c; (c = opt.next ()) != -1; ) + { + 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; + } + } + } +} |