There are two ways to create an Option; with the Option constructors or with the factory methods defined in Options. The method signatures of both approaches are identical.
The entries in the following table describe the method signatures of the constructors and of the factory methods using the names of the properties the parameters represent.
| API | API | Parameter Order |
|---|---|---|
| ctor | factory | Opt, Arg, Description |
| ctor | factory | Opt, LongOpt, Arg, Description |
| ctor | factory | Opt, LongOpt, Arg, Description, Required |
| ctor | factory | Opt, LongOpt, Arg, Description, Required, MultipleArgs |
| ctor | factory | Opt, LongOpt, Arg, Description, Required, MultipleArgs, Type |
To add an Option that has been created using a constructor the addOption method must be used.