diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java index b89580df1..8d06fee73 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java @@ -347,6 +347,7 @@ public class App { final String dataDirectory = cli.getDataDirectory(); final File propertiesFile = cli.getPropertiesFile(); final String suppressionFile = cli.getSuppressionFile(); + final String hintsFile = cli.getHintsFile(); final String nexusUrl = cli.getNexusUrl(); final String databaseDriverName = cli.getDatabaseDriverName(); final String databaseDriverPath = cli.getDatabaseDriverPath(); @@ -394,6 +395,7 @@ public class App { 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); //File Type Analyzer Settings diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java index df75602a1..863c58a90 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java @@ -277,6 +277,10 @@ public final class CliParser { .desc("The file path to the suppression XML file.") .build(); + final Option hintsFile = Option.builder().argName("file").hasArg().longOpt(ARGUMENT.HINTS_FILE) + .desc("The file path to the hints XML file.") + .build(); + final Option cveValidForHours = Option.builder().argName("hours").hasArg().longOpt(ARGUMENT.CVE_VALID_FOR_HOURS) .desc("The number of hours to wait before checking for new updates from the NVD.") .build(); @@ -305,6 +309,7 @@ public final class CliParser { .addOption(props) .addOption(verboseLog) .addOption(suppressionFile) + .addOption(hintsFile) .addOption(cveValidForHours) .addOption(experimentalEnabled); } @@ -962,6 +967,15 @@ public final class CliParser { return line.getOptionValue(ARGUMENT.SUPPRESSION_FILE); } + /** + * Returns the path to the hints file. + * + * @return the path to the hints file + */ + public String getHintsFile() { + return line.getOptionValue(ARGUMENT.HINTS_FILE); + } + /** *

* Prints the manifest information to standard output.

@@ -1273,9 +1287,14 @@ public final class CliParser { */ public static final String SUPPRESSION_FILE = "suppression"; /** - * The CLI argument name for setting the location of the suppression + * The CLI argument name for setting the location of the hint * file. */ + public static final String HINTS_FILE = "hints"; + /** + * The CLI argument name for setting the number of hours to wait before + * checking for new updates from the NVD. + */ public static final String CVE_VALID_FOR_HOURS = "cveValidForHours"; /** * Disables the Jar Analyzer.