From fe2cdfe81aad54149b5e6e6de6ededb76ff24d5a Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 20 Oct 2013 21:23:59 -0400 Subject: [PATCH] added cli argument to enable verbose logging Former-commit-id: 9d0d5edb8ad17cd72eb480f03c31b1c9a93ad735 --- .../owasp/dependencycheck/cli/CliParser.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/cli/CliParser.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/cli/CliParser.java index e3d180a3a..8b2715d93 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/cli/CliParser.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/cli/CliParser.java @@ -195,6 +195,10 @@ public final class CliParser { .withDescription("The output format to write to (XML, HTML, VULN, ALL). The default is HTML.") .create(ArgumentName.OUTPUT_FORMAT_SHORT); + final Option verboseLog = OptionBuilder.withArgName("file").hasArg().withLongOpt(ArgumentName.VERBOSE_LOG) + .withDescription("The file path to write verbose logging information.") + .create(ArgumentName.VERBOSE_LOG_SHORT); + final OptionGroup og = new OptionGroup(); og.addOption(path); @@ -208,6 +212,7 @@ public final class CliParser { opts.addOption(noUpdate); opts.addOption(props); opts.addOption(data); + opts.addOption(verboseLog); opts.addOption(proxyPort); opts.addOption(proxyUrl); opts.addOption(connectionTimeout); @@ -334,6 +339,28 @@ public final class CliParser { return line.getOptionValue(ArgumentName.DATA_DIRECTORY); } + /** + * Returns the properties file specified on the command line. + * + * @return the properties file specified on the command line + */ + public File getPropertiesFile() { + final String path = line.getOptionValue(ArgumentName.PROP); + if (path != null) { + return new File(path); + } + return null; + } + + /** + * Returns the path to the verbose log file. + * + * @return the path to the verbose log file + */ + public String getVerboseLog() { + return line.getOptionValue(ArgumentName.VERBOSE_LOG); + } + /** *

Prints the manifest information to standard output.

*