Find and create the command instance.
@param args the actual residual command line.
@return The command, or null if the command name is not recognized.
@throws CommandInitException Thrown when the command is recognized but failed to load.
179635
protected FindCommandResult findAndCreateCommand(String[] args) throws CommandInitException {
	  String commandName = args[0];
	  String[] remainingArguments = StringUtils.stripArgs(args, 1);
		
	  // Check top level commands for app
	  Class<? extends Command<? extends CLIContext>> commandClass = _commands.get(commandName);
		
		if (commandClass == null) {
			return null;
		}
		try {
		  // Create the instance of the root class and let that class hunt for any subcommands
		  Command<? extends CLIContext> rootCmd = (Command<? extends CLIContext>)commandClass.newInstance();
		  
			return rootCmd.findAndCreateCommand(remainingArguments);
		}
		catch (Exception e) {
			throw new CommandInitException(commandName);
		}
	}
334710
public ISUPMessage createCommand(int commandCode) {
        switch (commandCode) {
            case InitialAddressMessage.MESSAGE_CODE:
                InitialAddressMessage IAM = createIAM();
                return IAM;
            case AddressCompleteMessage.MESSAGE_CODE:
                AddressCompleteMessage ACM = createACM();
                return ACM;
            case ReleaseMessage.MESSAGE_CODE:
                ReleaseMessage REL = createREL(0);
                return REL;
            case ReleaseCompleteMessage.MESSAGE_CODE:
                ReleaseCompleteMessage RLC = createRLC();
                return RLC;

            case ApplicationTransportMessage.MESSAGE_CODE:
                ApplicationTransportMessage APT = createAPT();
                return APT;

            case AnswerMessage.MESSAGE_CODE:
                AnswerMessage ANM = createANM();
                return ANM;

            case CallProgressMessage.MESSAGE_CODE:
                CallProgressMessage CPG = createCPG();
                return CPG;

            case CircuitGroupResetAckMessage.MESSAGE_CODE:
                CircuitGroupResetAckMessage GRA = createGRA();
                return GRA;

            case ConfusionMessage.MESSAGE_CODE:
                ConfusionMessage CFN = createCNF();
                return CFN;

            case ConnectMessage.MESSAGE_CODE:
                ConnectMessage CON = createCON();
                return CON;

            case ContinuityMessage.MESSAGE_CODE:
                ContinuityMessage COT = createCOT();
                return COT;

            case FacilityRejectedMessage.MESSAGE_CODE:
                FacilityRejectedMessage FRJ = createFRJ();
                return FRJ;

            case InformationMessage.MESSAGE_CODE:
                InformationMessage INF = createINF();
                return INF;

            case InformationRequestMessage.MESSAGE_CODE:
                InformationRequestMessage INR = createINR();
                return INR;

            case SubsequentAddressMessage.MESSAGE_CODE:
                SubsequentAddressMessage SAM = createSAM();
                return SAM;

            case SubsequentDirectoryNumberMessage.MESSAGE_CODE:
                SubsequentDirectoryNumberMessage SDN = createSDN();
                return SDN;

            case ForwardTransferMessage.MESSAGE_CODE:
                ForwardTransferMessage FOT = createFOT();
                return FOT;

            case ResumeMessage.MESSAGE_CODE:
                ResumeMessage RES = createRES();
                return RES;
            case BlockingMessage.MESSAGE_CODE:
                BlockingMessage BLO = createBLO();
                return BLO;

            case BlockingAckMessage.MESSAGE_CODE:
                BlockingAckMessage BLA = createBLA();
                return BLA;

            case ContinuityCheckRequestMessage.MESSAGE_CODE:
                ContinuityCheckRequestMessage CCR = createCCR();
                return CCR;

            case LoopbackAckMessage.MESSAGE_CODE:
                LoopbackAckMessage LPA = createLPA();
                return LPA;

            case LoopPreventionMessage.MESSAGE_CODE:
                LoopPreventionMessage LPP = createLPP();
                return LPP;

            case OverloadMessage.MESSAGE_CODE:
                OverloadMessage OLM = createOLM();
                return OLM;

            case SuspendMessage.MESSAGE_CODE:
                SuspendMessage SUS = createSUS();
                return SUS;

            case ResetCircuitMessage.MESSAGE_CODE:
                ResetCircuitMessage RSC = createRSC();
                return RSC;

            case UnblockingMessage.MESSAGE_CODE:
                UnblockingMessage UBL = createUBL();
                return UBL;

            case UnblockingAckMessage.MESSAGE_CODE:
                UnblockingAckMessage UBA = createUBA();
                return UBA;

            case UnequippedCICMessage.MESSAGE_CODE:
                UnequippedCICMessage UCIC = createUCIC();
                return UCIC;

            case CircuitGroupBlockingMessage.MESSAGE_CODE:
                CircuitGroupBlockingMessage CGB = createCGB();
                return CGB;

            case CircuitGroupBlockingAckMessage.MESSAGE_CODE:
                CircuitGroupBlockingAckMessage CGBA = createCGBA();
                return CGBA;

            case CircuitGroupUnblockingMessage.MESSAGE_CODE:
                CircuitGroupUnblockingMessage CGU = createCGU();
                return CGU;

            case CircuitGroupUnblockingAckMessage.MESSAGE_CODE:
                CircuitGroupUnblockingAckMessage CGUA = createCGUA();
                return CGUA;

            case CircuitGroupResetMessage.MESSAGE_CODE:
                CircuitGroupResetMessage GRS = createGRS();
                return GRS;

            case CircuitGroupQueryResponseMessage.MESSAGE_CODE:
                CircuitGroupQueryResponseMessage CQR = createCQR();
                return CQR;

            case CircuitGroupQueryMessage.MESSAGE_CODE:
                CircuitGroupQueryMessage CQM = createCQM();
                return CQM;

            case FacilityAcceptedMessage.MESSAGE_CODE:
                FacilityAcceptedMessage FAA = createFAA();
                return FAA;

            case FacilityRequestMessage.MESSAGE_CODE:
                FacilityRequestMessage FAR = createFAR();
                return FAR;

            case PassAlongMessage.MESSAGE_CODE:
                PassAlongMessage PAM = createPAM();
                return PAM;

            case PreReleaseInformationMessage.MESSAGE_CODE:
                PreReleaseInformationMessage PRI = createPRI();
                return PRI;

            case FacilityMessage.MESSAGE_CODE:
                FacilityMessage FAC = createFAC();
                return FAC;

            case NetworkResourceManagementMessage.MESSAGE_CODE:
                NetworkResourceManagementMessage NRM = createNRM();
                return NRM;

            case IdentificationRequestMessage.MESSAGE_CODE:
                IdentificationRequestMessage IDR = createIDR();
                return IDR;

            case IdentificationResponseMessage.MESSAGE_CODE:
                IdentificationResponseMessage IRS = createIRS();
                return IRS;

            case SegmentationMessage.MESSAGE_CODE:
                SegmentationMessage SGM = createSGM();
                return SGM;

            case ChargeInformationMessage.MESSAGE_CODE:
                ChargeInformationMessage CIM = createCIM();
                return CIM;

            case UserPartAvailableMessage.MESSAGE_CODE:
                UserPartAvailableMessage UPA = createUPA();
                return UPA;

            case UserPartTestMessage.MESSAGE_CODE:
                UserPartTestMessage UPT = createUPT();
                return UPT;

            case UserToUserInformationMessage.MESSAGE_CODE:
                UserToUserInformationMessage USR = createUSR();
                return USR;
            default:
                throw new IllegalArgumentException("Not supported comamnd code: " + commandCode);
        }
    }
181428
public static RunOptions parseRunCommand(String[] args) throws CliArgsException {
		try {
			DefaultParser parser = new DefaultParser();
			CommandLine line = parser.parse(RUN_OPTIONS, args, true);
			return new RunOptions(line);
		}
		catch (ParseException e) {
			throw new CliArgsException(e.getMessage());
		}
	}
303036
public static void main(String[] args) {
    System.exit(getConf(
        ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults())), args));
  }
86867
public static void main(String[] args)
	{
		CommandLineRemoteRunner runner = new CommandLineRemoteRunner();
		LoggingMonitor monitor = new LoggingMonitor(System.out, System.err);
		runner.setMonitor(monitor);

		try
		{
			runner.run(args);
		}
		catch (ParseException e)
		{
			System.err.println(e.getMessage());
			System.err.println("Try '--help' for more information.");

			if (e.getCause() != null)
			{
				System.err.println("Caused by:");
				e.getCause().printStackTrace(System.err);
			}

			System.exit(1);
		}
		catch (Throwable t)
		{
			monitor.exceptionOccured(t);
			System.exit(1);
		}
	}
495215
protected CommandLine getOrCreateCommandLine() {
        try {
            CommandLine commandLine = (CommandLine) getProperty(COMMAND_LINE);
            if (commandLine == null) {
                commandLine = createCommandLine();
                // The script has a real property (a field or getter) but if we let Script.setProperty handle
                // this then it just gets stuffed into a binding that shadows the property.
                // This is somewhat related to other bugged behavior in Script wrt properties and bindings.
                // See http://jira.codehaus.org/browse/GROOVY-6582 for example.
                // The correct behavior for Script.setProperty would be to check whether
                // the property has a setter before creating a new script binding.
                this.getMetaClass().setProperty(this, COMMAND_LINE, commandLine);
            }
            return commandLine;
        } catch (MissingPropertyException mpe) {
            CommandLine commandLine = createCommandLine();
            // Since no property or binding already exists, we can use plain old setProperty here.
            setProperty(COMMAND_LINE, commandLine);
            return commandLine;
        }
    }
210548
public $.T2<String, String> commandLine(CommanderClassMetaInfo classMetaInfo, AppClassLoader classLoader) {
        boolean hasOptions = classMetaInfo.hasOption(classLoader);
        String firstArg = null;
        boolean hasMoreArgs = false;
        for (CommandParamMetaInfo param : params) {
            if (param.optionInfo() != null) {
                hasOptions = true;
            } else {
                if (firstArg == null) {
                    firstArg = param.name();
                } else {
                    hasMoreArgs = true;
                }
            }
        }
        for (FieldOptionAnnoInfo fieldOptionAnnoInfo : classMetaInfo.fieldOptionAnnoInfoList(classLoader)) {
            hasOptions = true;
            if (null == firstArg) {
                firstArg = fieldOptionAnnoInfo.fieldName();
            } else {
                hasMoreArgs = true;
            }
        }

        S.Buffer sb = S.buffer(commandName);
        if (hasOptions) {
            sb.append(" [options]");
        }
        if (null != firstArg) {
            sb.append(" ");
            sb.append("[").append(firstArg);
            if (hasMoreArgs) {
                sb.append("...");
            }
            sb.append("]");
        }
        return $.T2(sb.toString(), helpMsg());
    }
798025
public final int getNumberOfCommandLineArgs() {
        if (commandLine == null) {
            return 0;
        }
        List<?> args = commandLine.getArgList();
        if (args == null) {
            return 0;
        }
        return args.size();
    }
617533
public RetrievalToolConfig processCommandLine(String[] args) {
        RetrievalToolConfig config = null;
        try {
            config = processOptions(args);
        } catch (ParseException e) {
            printHelp(e.getMessage());
        }

        // Make sure work dir is set
        RetrievalConfig.setWorkDir(config.getWorkDir());
        config.setWorkDir(RetrievalConfig.getWorkDir());

        return config;
    }
493826
public static void main(final String[] args) {
    LOG.log(Level.INFO, "Entering Launch at :::" + new Date());
    try {
      if (args == null || args.length == 0) {
        throw new IllegalArgumentException("No arguments provided, at least a clrFolder should be supplied.");
      }
      final File dotNetFolder = new File(args[0]).getAbsoluteFile();
      final String[] removedArgs = Arrays.copyOfRange(args, 1, args.length);

      final Configuration config = getClientConfiguration(removedArgs);
      final Injector commandLineInjector = Tang.Factory.getTang().newInjector(parseCommandLine(removedArgs));
      final int waitTime = commandLineInjector.getNamedInstance(WaitTimeForDriver.class);
      final int driverMemory = commandLineInjector.getNamedInstance(DriverMemoryInMb.class);
      final boolean isLocal = commandLineInjector.getNamedInstance(Local.class);
      final String driverIdentifier = commandLineInjector.getNamedInstance(DriverIdentifier.class);
      final String jobSubmissionDirectory = commandLineInjector.getNamedInstance(DriverJobSubmissionDirectory.class);
      final boolean submit = commandLineInjector.getNamedInstance(Submit.class);
      final Injector injector = Tang.Factory.getTang().newInjector(config);
      final JobClient client = injector.getInstance(JobClient.class);
      client.setDriverInfo(driverIdentifier, driverMemory, jobSubmissionDirectory);

      if (submit) {
        client.submit(dotNetFolder, true, isLocal, null);
        client.waitForCompletion(waitTime);
      } else {
        client.submit(dotNetFolder, false, isLocal, config);
        client.waitForCompletion(0);
      }


      LOG.info("Done!");
    } catch (final BindException | InjectionException | IOException ex) {
      LOG.log(Level.SEVERE, "Job configuration error", ex);
    }
  }
493528
public static JUnitCommandLineParseResult parse(String[] args) {
        JUnitCommandLineParseResult result = new JUnitCommandLineParseResult();

        result.parseArgs(args);

        return result;
    }
342677
@SuppressWarnings("unchecked")
	public static void main(String[] args)
	{
		List<File> filenames = new Vector<File>();
		List<File> pathnames = new Vector<File>();
		List<String> largs = Arrays.asList(args);
		VDMJ controller = null;
		Dialect dialect = Dialect.VDM_SL;
		String remoteName = null;
		Class<RemoteControl> remoteClass = null;
		String defaultName = null;

		Properties.init(); // Read properties file, if any
		Settings.usingCmdLine = true;
		
		if(largs.contains("-version"))
		{
			println(getOvertureVersion());
			System.exit(0);
		}
		
		for (Iterator<String> i = largs.iterator(); i.hasNext();)
		{
			String arg = i.next();

			if (arg.equals("-vdmsl"))
			{
				controller = new VDMSL();
				dialect = Dialect.VDM_SL;
			} else if (arg.equals("-vdmpp"))
			{
				controller = new VDMPP();
				dialect = Dialect.VDM_PP;
			} else if (arg.equals("-vdmrt"))
			{
				controller = new VDMRT();
				dialect = Dialect.VDM_RT;
			} else if (arg.equals("-w"))
			{
				warnings = false;
			} else if (arg.equals("-i"))
			{
				interpret = true;
			} else if (arg.equals("-p"))
			{
				pog = true;
			} else if (arg.equals("-q"))
			{
				quiet = true;
			} else if (arg.equals("-e"))
			{
				Settings.usingCmdLine = false;
				interpret = true;
				pog = false;

				if (i.hasNext())
				{
					script = i.next();
				} else
				{
					usage("-e option requires an expression");
				}
			} else if (arg.equals("-o"))
			{
				if (i.hasNext())
				{
					if (outfile != null)
					{
						usage("Only one -o option allowed");
					}

					outfile = i.next();
				} else
				{
					usage("-o option requires a filename");
				}
			} else if (arg.equals("-c"))
			{
				if (i.hasNext())
				{
					filecharset = validateCharset(i.next());
				} else
				{
					usage("-c option requires a charset name");
				}
			} else if (arg.equals("-t"))
			{
				if (i.hasNext())
				{
					Console.setCharset(validateCharset(i.next()));
				} else
				{
					usage("-t option requires a charset name");
				}
			} else if (arg.equals("-r"))
			{
				if (i.hasNext())
				{
					Settings.release = Release.lookup(i.next());

					if (Settings.release == null)
					{
						usage("-r option must be " + Release.list());
					}
				} else
				{
					usage("-r option requires a VDM release");
				}
			} else if (arg.equals("-pre"))
			{
				Settings.prechecks = false;
			} else if (arg.equals("-post"))
			{
				Settings.postchecks = false;
			} else if (arg.equals("-inv"))
			{
				Settings.invchecks = false;
			} else if (arg.equals("-dtc"))
			{
				// NB. Turn off both when no DTC
				Settings.invchecks = false;
				Settings.dynamictypechecks = false;
			} else if (arg.equals("-measures"))
			{
				Settings.measureChecks = false;
			} else if (arg.equals("-log"))
			{
				if (i.hasNext())
				{
					logfile = i.next();
				} else
				{
					usage("-log option requires a filename");
				}
			} else if (arg.equals("-remote"))
			{
				if (i.hasNext())
				{
					interpret = true;
					remoteName = i.next();
				} else
				{
					usage("-remote option requires a Java classname");
				}
			} else if (arg.equals("-default"))
			{
				if (i.hasNext())
				{
					defaultName = i.next();
				} else
				{
					usage("-default option requires a name");
				}
			} else if (arg.equals("-path"))
			{
				if (i.hasNext())
				{
					File path = new File(i.next());

					if (path.isDirectory())
					{
						pathnames.add(path);
					} else
					{
						usage(path + " is not a directory");
					}
				} else
				{
					usage("-path option requires a directory");
				}
			}else if (arg.equals("-baseDir"))
			{
				if (i.hasNext())
				{
					try
					{
						Settings.baseDir = new File(i.next());
					} catch (IllegalArgumentException e)
					{
						usage(e.getMessage() + ": " + arg);
					}
				} else
				{
					usage("-baseDir option requires a folder name");
				}
			}  else if (arg.startsWith("-"))
			{
				usage("Unknown option " + arg);
			} else
			{
				// It's a file or a directory
				File file = new File(arg);

				if (file.isDirectory())
				{
					for (File subFile : file.listFiles(dialect.getFilter()))
					{
						if (subFile.isFile())
						{
							filenames.add(subFile);
						}
					}
				} else
				{
					if (file.exists())
					{
						filenames.add(file);
					} else
					{
						boolean OK = false;

						for (File path : pathnames)
						{
							File pfile = new File(path, arg);

							if (pfile.exists())
							{
								filenames.add(pfile);
								OK = true;
								break;
							}
						}

						if (!OK)
						{
							usage("Cannot find file " + file);
						}

					}
				}
			}
		}

		if (controller == null)
		{
			usage("You must specify either -vdmsl, -vdmpp or -vdmrt");
		}

		if (logfile != null && !(controller instanceof VDMRT))
		{
			usage("The -log option can only be used with -vdmrt");
		}

		if (remoteName != null)
		{
			try
			{
				Class<?> cls = ClassLoader.getSystemClassLoader().loadClass(remoteName);
				remoteClass = (Class<RemoteControl>) cls;
			} catch (ClassNotFoundException e)
			{
				usage("Cannot locate " + remoteName + " on the CLASSPATH");
			}
		}

		ExitStatus status = null;

		if (filenames.isEmpty() && (!interpret || remoteClass != null))
		{
			usage("You didn't specify any files");
			status = ExitStatus.EXIT_ERRORS;
		} else
		{
			do
			{
				if (filenames.isEmpty())
				{
					status = controller.interpret(filenames, null);
				} else
				{
					status = controller.parse(filenames);

					if (status == ExitStatus.EXIT_OK)
					{
						status = controller.typeCheck();

						if (status == ExitStatus.EXIT_OK && interpret)
						{
							if (remoteClass == null)
							{
								status = controller.interpret(filenames, defaultName);
							} else
							{
								try
								{
									final RemoteControl remote = remoteClass.newInstance();
									Interpreter i = controller.getInterpreter();

									if (defaultName != null)
									{
										i.setDefaultName(defaultName);
									}

									i.init(null);

									try
									{
										// remote.run(new RemoteInterpreter(i, null));
										final RemoteInterpreter remoteInterpreter = new RemoteInterpreter(i, null);
										Thread remoteThread = new Thread(new Runnable()
										{

											public void run()
											{
												try
												{
													remote.run(remoteInterpreter);
												} catch (Exception e)
												{
													println(e.getMessage());
													// status = ExitStatus.EXIT_ERRORS;
												}
											}
										});
										remoteThread.setName("RemoteControl runner");
										remoteThread.setDaemon(true);
										remoteThread.start();
										remoteInterpreter.processRemoteCalls();
										status = ExitStatus.EXIT_OK;
									} catch (Exception e)
									{
										println(e.getMessage());
										status = ExitStatus.EXIT_ERRORS;
									}
								} catch (InstantiationException e)
								{
									usage("Cannot instantiate " + remoteName);
								} catch (Exception e)
								{
									usage(e.getMessage());
								}
							}
						}
					}
				}
			} while (status == ExitStatus.RELOAD);
		}

		if (interpret)
		{
			infoln("Bye");
		}

		System.exit(status == ExitStatus.EXIT_OK ? 0 : 1);
	}
762806
public static void main(String[] arg) {

        System.getProperties().put("sun.java2d.noddraw", "true");

        // (ulrivo): read all arguments from the command line
        String  lowerArg;
        String  urlid        = null;
        String  rcFile       = null;
        boolean autoConnect  = false;
        boolean urlidConnect = false;

        bMustExit = true;

        for (int i = 0; i < arg.length; i++) {
            lowerArg = arg[i].toLowerCase();

            if (lowerArg.startsWith("--")) {
                lowerArg = lowerArg.substring(1);
            }

            i++;

            if (lowerArg.equals("-driver")) {
                defDriver   = arg[i];
                autoConnect = true;
            } else if (lowerArg.equals("-url")) {
                defURL      = arg[i];
                autoConnect = true;
            } else if (lowerArg.equals("-user")) {
                defUser     = arg[i];
                autoConnect = true;
            } else if (lowerArg.equals("-password")) {
                defPassword = arg[i];
                autoConnect = true;
            } else if (lowerArg.equals("-urlid")) {
                urlid        = arg[i];
                urlidConnect = true;
            } else if (lowerArg.equals("-rcfile")) {
                rcFile       = arg[i];
                urlidConnect = true;
            } else if (lowerArg.equals("-dir")) {
                defDirectory = arg[i];
            } else if (lowerArg.equals("-script")) {
                defScript = arg[i];
            } else if (lowerArg.equals("-noexit")) {
                bMustExit = false;

                i--;
            } else if (lowerArg.equals("-help")) {
                showUsage();
                return;
            } else {
                /* Syntax ERRORS should either throw or exit with non-0 status.
                 * In our case, it may be unsafe to exit, so we throw.
                 * (I.e. should provide easy way for caller to programmatically
                 * determine that there was an invocation problem).
                 */

                throw new IllegalArgumentException(
                        "Try:  java... " + DatabaseManagerSwing.class.getName()
                        + " --help");
                // No reason to localize, since the main syntax message is
                // not localized.
            }
        }

        DatabaseManagerSwing m =
            new DatabaseManagerSwing(new JFrame("HSQL Database Manager"));

        // Added: (weconsultants@users): Need databaseManagerSwing for later Reference
        refForFontDialogSwing = m;

        m.main();

        Connection c = null;

        m.setWaiting("Initializing");

        try {
            if (autoConnect && urlidConnect) {
                throw new IllegalArgumentException(
                    "You may not specify both (urlid) AND (url/user/password).");
            }

            if (autoConnect) {
                c = ConnectionDialogSwing.createConnection(defDriver, defURL,
                        defUser, defPassword);
            } else if (urlidConnect) {
                if (urlid == null) {
                    throw new IllegalArgumentException(
                        "You must specify an 'urlid' to use an RC file");
                }

                autoConnect = true;

                String rcfilepath = (rcFile == null) ? DEFAULT_RCFILE
                                                     : rcFile;
                RCData rcdata     = new RCData(new File(rcfilepath), urlid);

                c = rcdata.getConnection(
                    null, System.getProperty("sqlfile.charset"),
                    System.getProperty("javax.net.ssl.trustStore"));
            } else {
                c = ConnectionDialogSwing.createConnection(m.jframe,
                        "Connect");
            }
        } catch (Exception e) {

            //  Added: (weconsultants@users)
            CommonSwing.errorMessage(e);
        } finally {
            m.setWaiting(null);
        }

        if (c != null) {
            m.connect(c);
        }

        // Added: (weconsultants@users): For preloadng FontDialogSwing
        FontDialogSwing.creatFontDialog(refForFontDialogSwing);
        m.start();
    }
187018
public static void setAllCommandLine(String[] args) {
      if (args != null) {
         CommandLineParser parser = new CommandLineParser();
         parser.parse(args);
         setAllCommandLine(parser);
      }
   }
42799
public static void main(final String[] args)
      throws IOException, JDOMException {
    CLI cmdLine = new CLI();
    cmdLine.parseCLI(args);
  }
618169
public static void main(final String[] args) {
        CommandLine cl = parseCommandLine(args);
        if (cl.hasOption("--help")) {
            if (!cl.hasOption("--conf")) {
                printUsage(null);
            }
        }

        if (cl.hasOption("--version")) {
            printVersion();
            System.exit(0);
        }

        JNRPEConfiguration conf = null;
        try {
            conf = loadConfiguration((String) cl.getValue("--conf"));
        } catch (Exception e) {
            System.out.println("Unable to parse the configuration at " + cl.getValue("--conf") + ". The error is : " + e.getMessage());
            e.printStackTrace();
            System.exit(-1);
        }

        String sPluginPath = conf.getServerSection().getPluginPath();
        if (sPluginPath == null) {
            System.out.println("Plugin path has not been specified");
            System.exit(-1);
        }
        File fPluginPath = new File(sPluginPath);

        if (fPluginPath.exists()) {
            if (!fPluginPath.isDirectory()) {
                System.out.println("Specified plugin path ('" + sPluginPath + "') must be a directory");
                System.exit(-1);
            }
        } else {
            System.out.println("Specified plugin path ('" + sPluginPath + "') do not exist");
            System.exit(-1);
        }

        IPluginRepository pr = null;
        try {
            pr = loadPluginDefinitions(conf.getServerSection().getPluginPath());
        } catch (PluginConfigurationException e) {
            System.out.println("An error has occurred while parsing " + "the plugin packages : " + e.getMessage());
            System.exit(-1);
        }

        if (cl.hasOption("--help") && cl.getValue("--help") != null) {
            printHelp(pr, (String) cl.getValue("--help"));
        }

        if (cl.hasOption("--list")) {
            printPluginList(pr);
        }

        CommandRepository cr = conf.createCommandRepository();

        JNRPEBuilder builder = JNRPEBuilder.forRepositories(pr, cr).acceptParams(conf.getServerSection().acceptParams())
                .withMaxAcceptedConnections(conf.getServerSection().getBacklogSize()).withReadTimeout(conf.getServerSection().getReadTimeout())
                .withWriteTimeout(conf.getServerSection().getWriteTimeout()).withListener(new EventLoggerListener());

        for (String sAcceptedAddress : conf.getServerSection().getAllowedAddresses()) {
            builder.acceptHost(sAcceptedAddress);
        }

        JNRPE jnrpe = builder.build();

        for (BindAddress bindAddress : conf.getServerSection().getBindAddresses()) {
            int iPort = DEFAULT_PORT;
            String[] vsParts = bindAddress.getBindingAddress().split(":");
            String sIp = vsParts[0];
            if (vsParts.length > 1) {
                iPort = Integer.parseInt(vsParts[1]);
            }

            try {
                jnrpe.listen(sIp, iPort, bindAddress.isSSL());
            } catch (UnknownHostException e) {
                System.out.println(String.format("Error binding the server to %s:%d : %s", sIp, iPort, e.getMessage()));
            }
        }

        if (cl.hasOption("--interactive")) {
            new JNRPEConsole(jnrpe, pr, cr).start();
            System.exit(0);
        }
    }
314221
public alluxio.grpc.FileSystemCommandOrBuilder getCommandOrBuilder() {
    return command_ == null ? alluxio.grpc.FileSystemCommand.getDefaultInstance() : command_;
  }