Options options = new Options ();
options.addOption (new HelpOption ());
PropertyFileOption propOption = new PropertyFileOption ();
options.addOption (propOption);
options.addOption (new PersistenceOption ());
PartyKeyOption partyKeyOption = new PartyKeyOption ();
options.addOption (partyKeyOption);
options.addOption (new ContactOption ());
options.addOption (new OldContactOption ());
try {
// parse the command line arguments
CommandLine line = parser.parse (options, args);
if (line.hasOption (HelpOption.cValue)) {
HelpFormatter hf = new HelpFormatter ();
hf.printHelp (EditPartyContact.class.toString (), options);
}
else {
long ptyKey = partyKeyOption.parseAsLong();
String newContact = line.getOptionValue (ContactOption.cValue);
String oldContact = null;
if (line.hasOption (OldContactOption.cValue)) {
oldContact = line.getOptionValue (OldContactOption.cValue);
}