@Override protected void executeThis() { AnsiUi.raw("Halyard Daemon Response: " + Daemon.shutdown()); } }
@Override protected void executeThis() { AnsiUi.raw("Halyard Daemon Response: " + Daemon.shutdown()); } }
@Override protected void executeThis() { String deploymentName = getCurrentDeployment(); NodeDiff result = new OperationHandler<NodeDiff>() .setFailureMesssage("Failed to generate config diff.") .setOperation(Daemon.configDiff(deploymentName, !noValidate)) .get(); if (result == null) { AnsiUi.raw("No changes have been made to your configuration."); } else { AnsiUi.raw(AnsiFormatUtils.format(result)); } } }
@Override protected void executeThis() { String deploymentName = getCurrentDeployment(); NodeDiff result = new OperationHandler<NodeDiff>() .setFailureMesssage("Failed to generate config diff.") .setOperation(Daemon.configDiff(deploymentName, !noValidate)) .get(); if (result == null) { AnsiUi.raw("No changes have been made to your configuration."); } else { AnsiUi.raw(AnsiFormatUtils.format(result)); } } }
/** * This recursively walks the chain of subcommands, until it finds the last in the chain, and runs executeThis. * * @see NestableCommand#executeThis() */ public void execute() { String subCommand = commander.getParsedCommand(); if (subCommand == null) { if (help) { showHelp(); } else { if (this instanceof DeprecatedCommand) { AnsiUi.warning("This command is deprecated."); AnsiUi.warning(((DeprecatedCommand) this).getDeprecatedWarning()); } if (this instanceof ProtectedCommand && !GlobalOptions.getGlobalOptions().isQuiet()) { String prompt = ((ProtectedCommand) this).getPrompt(); Console console = System.console(); String input = console.readLine(prompt + " Do you want to continue? (y/N) "); if (!input.equalsIgnoreCase("y")) { AnsiUi.raw("Aborted."); return; } } safeExecuteThis(); } } else { subcommands.get(subCommand).execute(); } }
/** * This recursively walks the chain of subcommands, until it finds the last in the chain, and runs executeThis. * * @see NestableCommand#executeThis() */ public void execute() { String subCommand = commander.getParsedCommand(); if (subCommand == null) { if (help) { showHelp(); } else { if (this instanceof DeprecatedCommand) { AnsiUi.warning("This command is deprecated."); AnsiUi.warning(((DeprecatedCommand) this).getDeprecatedWarning()); } if (this instanceof ProtectedCommand && !GlobalOptions.getGlobalOptions().isQuiet()) { String prompt = ((ProtectedCommand) this).getPrompt(); Console console = System.console(); String input = console.readLine(prompt + " Do you want to continue? (y/N) "); if (!input.equalsIgnoreCase("y")) { AnsiUi.raw("Aborted."); return; } } safeExecuteThis(); } } else { subcommands.get(subCommand).execute(); } }
AnsiUi.raw("");
if (options != null) { List<String> available = options(translateFieldName(options)); AnsiUi.raw(String.join(" ", available)); } else { executeThis();
if (options != null) { List<String> available = options(translateFieldName(options)); AnsiUi.raw(String.join(" ", available)); } else { executeThis();
@Override protected S3PersistentStore editPersistentStore(S3PersistentStore persistentStore) { if(isSet(bucket) && bucket.startsWith("s3://")){ bucket = bucket.substring(5); //Line to edit out the "s3://" part of the bucket string } persistentStore.setBucket(isSet(bucket) ? bucket : persistentStore.getBucket()); persistentStore.setRootFolder(isSet(rootFolder) ? rootFolder : persistentStore.getRootFolder()); persistentStore.setRegion(isSet(region) ? region : persistentStore.getRegion()); persistentStore.setEndpoint(isSet(endpoint) ? endpoint : persistentStore.getEndpoint()); persistentStore.setAccessKeyId(isSet(accessKeyId) ? accessKeyId : persistentStore.getAccessKeyId()); persistentStore.setSecretAccessKey(isSet(secretAccessKey) ? secretAccessKey : persistentStore.getSecretAccessKey()); if (persistentStore.getBucket() == null) { String bucketName = "spin-" + UUID.randomUUID().toString(); AnsiUi.raw("Generated bucket name: " + bucketName); persistentStore.setBucket(bucketName); } return persistentStore; } }
@Override protected S3PersistentStore editPersistentStore(S3PersistentStore persistentStore) { if(isSet(bucket) && bucket.startsWith("s3://")){ bucket = bucket.substring(5); //Line to edit out the "s3://" part of the bucket string } persistentStore.setBucket(isSet(bucket) ? bucket : persistentStore.getBucket()); persistentStore.setRootFolder(isSet(rootFolder) ? rootFolder : persistentStore.getRootFolder()); persistentStore.setRegion(isSet(region) ? region : persistentStore.getRegion()); persistentStore.setEndpoint(isSet(endpoint) ? endpoint : persistentStore.getEndpoint()); persistentStore.setAccessKeyId(isSet(accessKeyId) ? accessKeyId : persistentStore.getAccessKeyId()); persistentStore.setSecretAccessKey(isSet(secretAccessKey) ? secretAccessKey : persistentStore.getSecretAccessKey()); if (persistentStore.getBucket() == null) { String bucketName = "spin-" + UUID.randomUUID().toString(); AnsiUi.raw("Generated bucket name: " + bucketName); persistentStore.setBucket(bucketName); } return persistentStore; } }
@Override protected GcsPersistentStore editPersistentStore(GcsPersistentStore persistentStore) { persistentStore.setProject(isSet(project) ? project : persistentStore.getProject()); persistentStore.setJsonPath(isSet(jsonPath) ? jsonPath : persistentStore.getJsonPath()); persistentStore.setBucket(isSet(bucket) ? bucket : persistentStore.getBucket()); persistentStore.setRootFolder(isSet(rootFolder) ? rootFolder : persistentStore.getRootFolder()); persistentStore.setBucketLocation(isSet(bucketLocation) ? bucketLocation : persistentStore.getBucketLocation()); if (persistentStore.getBucket() == null) { String bucketName = "spin-" + UUID.randomUUID().toString(); AnsiUi.raw("Generated bucket name: " + bucketName); persistentStore.setBucket(bucketName); } return persistentStore; } }
@Override protected GcsPersistentStore editPersistentStore(GcsPersistentStore persistentStore) { persistentStore.setProject(isSet(project) ? project : persistentStore.getProject()); persistentStore.setJsonPath(isSet(jsonPath) ? jsonPath : persistentStore.getJsonPath()); persistentStore.setBucket(isSet(bucket) ? bucket : persistentStore.getBucket()); persistentStore.setRootFolder(isSet(rootFolder) ? rootFolder : persistentStore.getRootFolder()); persistentStore.setBucketLocation(isSet(bucketLocation) ? bucketLocation : persistentStore.getBucketLocation()); if (persistentStore.getBucket() == null) { String bucketName = "spin-" + UUID.randomUUID().toString(); AnsiUi.raw("Generated bucket name: " + bucketName); persistentStore.setBucket(bucketName); } return persistentStore; } }
paragraphBuilder.addSnippet(action.getScriptPath()).addStyle(AnsiStyle.UNDERLINE); AnsiUi.raw(storyBuilder.toString()); } else { List<String> command = new ArrayList<>();
paragraphBuilder.addSnippet(action.getScriptPath()).addStyle(AnsiStyle.UNDERLINE); AnsiUi.raw(storyBuilder.toString()); } else { List<String> command = new ArrayList<>();