if (argParser.getBooleanValue(helpOpt)) if (argParser.getBooleanValue(versionOpt))
@Test public void testGetBooleanValue() throws ParseException { ArgumentParser argParser = new ArgumentParser(""); Option boolOpt = argParser.addArgument("b", "bool", false, "Some optional configuration flag", false); Boolean resultValue; final String shortBoolOpt = String.format("-%s", boolOpt.getOpt()); final String longBoolOpt = String.format("--%s", boolOpt.getLongOpt()); argParser.parseArguments(new String[] {}); resultValue = argParser.getBooleanValue(boolOpt); assertNotNull(resultValue); assertFalse(resultValue); argParser.parseArguments(new String[] {shortBoolOpt}); resultValue = argParser.getBooleanValue(boolOpt); assertNotNull(resultValue); assertTrue(resultValue); argParser.parseArguments(new String[] {longBoolOpt}); resultValue = argParser.getBooleanValue(boolOpt); assertNotNull(resultValue); assertTrue(resultValue); }
if (argParser.getBooleanValue(helpOpt)) if (argParser.getBooleanValue(versionOpt))
if (argParser.getBooleanValue(helpOpt)) if (argParser.getBooleanValue(versionOpt))
if (argParser.getBooleanValue(helpOpt)) if (argParser.getBooleanValue(versionOpt))
S3FileTransferRequestParamsDto.builder().withLocalPath(argParser.getStringValue(localPathOpt)).withUseRrs(argParser.getBooleanValue(rrsOpt)) .withAwsAccessKeyId(argParser.getStringValue(s3AccessKeyOpt)).withAwsSecretKey(argParser.getStringValue(s3SecretKeyOpt)) .withS3Endpoint(argParser.getStringValue(s3EndpointOpt)).withMaxThreads(maxThreads) .withUsername(argParser.getStringValue(usernameOpt)).withPassword(argParser.getStringValue(passwordOpt)) .withTrustSelfSignedCertificate(trustSelfSignedCertificate).withDisableHostnameVerification(disableHostnameVerification).build(); controller.performUpload(regServerAccessParamsDto, argParser.getFileValue(manifestPathOpt), params, argParser.getBooleanValue(createNewVersionOpt), argParser.getBooleanValue(forceOpt), maxRetryAttempts, retryDelaySecs);