@Test public void canParseUserIdFromCommandLine() throws Exception { parser.parse("-U myuserid".split(" "), dbDeploy); assertEquals("myuserid", dbDeploy.getUserid()); }
public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); void parse(String[] args, DbDeploy dbDeploy); void printUsage(); }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); void parse(String[] args, DbDeploy dbDeploy); void printUsage();  }