@Override public String getDescription(ExecutionContext context) { ImmutableList.Builder<String> args = ImmutableList.builder(); args.add("unzip"); Verbosity verbosity = context.getVerbosity(); if (!verbosity.shouldUseVerbosityFlagIfAvailable()) { if (verbosity.shouldPrintStandardInformation()) { args.add("-q"); } else { args.add("-qq"); } } // overwrite existing files without prompting if (overwriteExistingFiles) { args.add("-o"); } // output directory args.add("-d").add(pathToDestinationDirectory); // file to unzip args.add(pathToZipFile); // specific files within the archive to unzip -- if empty, extract all args.addAll(filesToExtract); return Joiner.on(" ").join(args.build()); }
@Override protected boolean shouldPrintStderr(Verbosity verbosity) { return verbosity.shouldPrintStandardInformation(); }