@Override protected void parseCommandLine(CommandLine cmd, Options options) throws Shell.ExitCodeException { super.parseCommandLine(cmd, options); boolean readOnly = THRIFT_READONLY_ENABLED_DEFAULT; if (cmd.hasOption(READONLY_OPTION)) { readOnly = true; } conf.setBoolean(THRIFT_READONLY_ENABLED, readOnly); }
/** * Parse the command line options to set parameters the conf. */ protected void processOptions(final String[] args) throws Exception { if (args == null || args.length == 0) { return; } Options options = new Options(); addOptions(options); CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help")) { printUsageAndExit(options, 1); } parseCommandLine(cmd, options); }