Previous Topic

Next Topic

Book Contents

Book Index

Supplying Arrays and Collections as Options

If you have a command with an option which is an array or an implementation of the Collection interface, you have to supply the name of the option before every array/collection element.

This is implemented because arguments and options have to be distinguished, and when given in the command they can be in mixed order, as in the following example.

Example:

myCommand -o opt1 -o opt2 -o opt3 arg1 -o opt4 arg2 arg3

This would result in a command with an option array or collection for -o of

{"opt1","opt2","opt3","opt4"}

and

"arg1","arg2","arg3"

as arguments.