if (args.length < 1) { pu.interactive(false); } else if (args.length == 1 && args[0].equals("-v")) { pu.interactive(true); } else { try { if (!pu.execute(args))
CommandLineParser parser = new GnuParser(); Options options = new Options(); options.addOption("h", "help", false, "display usage"); options.addOption("s", "server", true, "host[:port] of server to connect to"); options.addOption("l", "ldap", false, "provision via LDAP"); options.addOption("a", "account", true, "account name (not used with --ldap)"); options.addOption("p", "password", true, "password for account"); options.addOption("v", "verbose", false, "verbose mode");  CommandLine cl = null; boolean err = false;  try { cl = parser.parse(options, args); } catch (ParseException pe) { System.err.println("error: " + pe.getMessage()); err = true; }  if (err || cl.hasOption('h')) { pu.usage(); }  pu.setVerbose(cl.hasOption('v')); if (cl.hasOption('l')) pu.setUseLdap(true); if (cl.hasOption('s')) pu.setServer(cl.getOptionValue('s')); if (cl.hasOption('a')) pu.setAccount(cl.getOptionValue('a')); if (cl.hasOption('p')) pu.setPassword(cl.getOptionValue('p'));  args = cl.getArgs();  try { pu.initProvisioning(); if (args.length < 1) { pu.interactive(); } else { try { if (!pu.execute(args)) pu.usage(); } catch (ArgException e) {
    public static void main(String args[]) throws IOException {        Zimbra.toolSetup();                ProvUtil pu = new ProvUtil();        if (args.length < 1) {            pu.interactive(false);        } else if (args.length == 1 && args[0].equals("-v")) {            pu.interactive(true);        } else {            try {                if (!pu.execute(args))                    pu.usage();            } catch (ServiceException e) {            	Throwable cause = e.getCause();                System.err.println("ERROR: " + e.getCode() + " (" + e.getMessage() + ")" +                 		(cause == null ? "" : " (cause: " + cause.getClass().getName() + " " + cause.getMessage() + ")"));                  System.exit(2);            } catch (ArgException e) {                pu.usage();            }        }    }