mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 16:49:43 +01:00
added cli argument to enable verbose logging
Former-commit-id: 261ad7be19eb3058d5bc9521a5c462c2d2ed5f44
This commit is contained in:
@@ -195,6 +195,10 @@ public final class CliParser {
|
|||||||
.withDescription("The output format to write to (XML, HTML, VULN, ALL). The default is HTML.")
|
.withDescription("The output format to write to (XML, HTML, VULN, ALL). The default is HTML.")
|
||||||
.create(ArgumentName.OUTPUT_FORMAT_SHORT);
|
.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();
|
final OptionGroup og = new OptionGroup();
|
||||||
og.addOption(path);
|
og.addOption(path);
|
||||||
|
|
||||||
@@ -208,6 +212,7 @@ public final class CliParser {
|
|||||||
opts.addOption(noUpdate);
|
opts.addOption(noUpdate);
|
||||||
opts.addOption(props);
|
opts.addOption(props);
|
||||||
opts.addOption(data);
|
opts.addOption(data);
|
||||||
|
opts.addOption(verboseLog);
|
||||||
opts.addOption(proxyPort);
|
opts.addOption(proxyPort);
|
||||||
opts.addOption(proxyUrl);
|
opts.addOption(proxyUrl);
|
||||||
opts.addOption(connectionTimeout);
|
opts.addOption(connectionTimeout);
|
||||||
@@ -334,6 +339,28 @@ public final class CliParser {
|
|||||||
return line.getOptionValue(ArgumentName.DATA_DIRECTORY);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Prints the manifest information to standard output.</p>
|
* <p>Prints the manifest information to standard output.</p>
|
||||||
* <ul><li>Implementation-Title: ${pom.name}</li>
|
* <ul><li>Implementation-Title: ${pom.name}</li>
|
||||||
@@ -469,5 +496,14 @@ public final class CliParser {
|
|||||||
* directory.
|
* directory.
|
||||||
*/
|
*/
|
||||||
public static final String DATA_DIRECTORY_SHORT = "d";
|
public static final String DATA_DIRECTORY_SHORT = "d";
|
||||||
|
/**
|
||||||
|
* The CLI argument name for setting the location of the data directory.
|
||||||
|
*/
|
||||||
|
public static final String VERBOSE_LOG = "log";
|
||||||
|
/**
|
||||||
|
* The short CLI argument name for setting the location of the data
|
||||||
|
* directory.
|
||||||
|
*/
|
||||||
|
public static final String VERBOSE_LOG_SHORT = "l";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user