opts.addOption(helpOpt);
Option execCommandOpt = new Option("e", "execute-command", true, "executes a command, and then exits");
opts.addOption(execCommandOpt);
OptionGroup execFileGroup = new OptionGroup();
Option execfileOption = new Option("f", "execute-file", true, "executes commands from a file at startup");
execfileOption.setArgName("file");
execFileGroup.addOption(execfileOption);
Option execfileVerboseOption = new Option("fv", "execute-file-verbose", true, "executes commands from a file at startup, with commands shown");
execfileVerboseOption.setArgName("file");
execFileGroup.addOption(execfileVerboseOption);
opts.addOptionGroup(execFileGroup);
OptionGroup instanceOptions = new OptionGroup();
Option hdfsZooInstance = new Option("h", "hdfsZooInstance", false, "use hdfs zoo instance");
instanceOptions.addOption(hdfsZooInstance);
Option zooKeeperInstance = new Option("z", "zooKeeperInstance", true, "use a zookeeper instance with the given instance name and list of zoo hosts");
zooKeeperInstance.setArgName("name hosts");
zooKeeperInstance.setArgs(2);
instanceOptions.addOption(zooKeeperInstance);
opts.addOptionGroup(instanceOptions);
OptionGroup authTimeoutOptions = new OptionGroup();
Option authTimeoutOpt = new Option(null, "auth-timeout", true, "minutes the shell can be idle without re-entering a password (default "
+ DEFAULT_AUTH_TIMEOUT + " min)");
authTimeoutOpt.setArgName("minutes");
authTimeoutOptions.addOption(authTimeoutOpt);
Option disableAuthTimeoutOpt = new Option(null, "disable-auth-timeout", false, "disables requiring the user to re-type a password after being idle");
authTimeoutOptions.addOption(disableAuthTimeoutOpt);
opts.addOptionGroup(authTimeoutOptions);
CommandLine cl;
try {