mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-04-30 04:04:30 +02:00
Issue #730: Allow multiple args for CLI suppresion
The core has not been extended but the CLI is able to parse and pass to the Settings singleton This change to the CLI is backwards compatible
This commit is contained in:
@@ -387,7 +387,7 @@ public class App {
|
||||
final String proxyPass = cli.getProxyPassword();
|
||||
final String dataDirectory = cli.getDataDirectory();
|
||||
final File propertiesFile = cli.getPropertiesFile();
|
||||
final String suppressionFile = cli.getSuppressionFile();
|
||||
final String[] suppressionFiles = cli.getSuppressionFiles();
|
||||
final String hintsFile = cli.getHintsFile();
|
||||
final String nexusUrl = cli.getNexusUrl();
|
||||
final String databaseDriverName = cli.getDatabaseDriverName();
|
||||
@@ -436,10 +436,11 @@ public class App {
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.PROXY_USERNAME, proxyUser);
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PASSWORD, proxyPass);
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.HINTS_FILE, hintsFile);
|
||||
Settings.setIntIfNotNull(Settings.KEYS.CVE_CHECK_VALID_FOR_HOURS, cveValidForHours);
|
||||
|
||||
Settings.setArrayIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFiles);
|
||||
|
||||
//File Type Analyzer Settings
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_EXPERIMENTAL_ENABLED, experimentalEnabled);
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public final class CliParser {
|
||||
.desc("Sets how deep nested symbolic links will be followed; 0 indicates symbolic links will not be followed.")
|
||||
.build();
|
||||
|
||||
final Option suppressionFile = Option.builder().argName("file").hasArg().longOpt(ARGUMENT.SUPPRESSION_FILE)
|
||||
final Option suppressionFile = Option.builder().argName("file").hasArgs().longOpt(ARGUMENT.SUPPRESSION_FILES)
|
||||
.desc("The file path to the suppression XML file.")
|
||||
.build();
|
||||
|
||||
@@ -1020,12 +1020,12 @@ public final class CliParser {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to the suppression file.
|
||||
* Returns the paths to the suppression files.
|
||||
*
|
||||
* @return the path to the suppression file
|
||||
* @return the paths to the suppression files.
|
||||
*/
|
||||
public String getSuppressionFile() {
|
||||
return line.getOptionValue(ARGUMENT.SUPPRESSION_FILE);
|
||||
public String[] getSuppressionFiles() {
|
||||
return line.getOptionValues(ARGUMENT.SUPPRESSION_FILES);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1363,9 +1363,9 @@ public final class CliParser {
|
||||
public static final String SYM_LINK_DEPTH = "symLink";
|
||||
/**
|
||||
* The CLI argument name for setting the location of the suppression
|
||||
* file.
|
||||
* file(s).
|
||||
*/
|
||||
public static final String SUPPRESSION_FILE = "suppression";
|
||||
public static final String SUPPRESSION_FILES = "suppression";
|
||||
/**
|
||||
* The CLI argument name for setting the location of the hint file.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user