Skip to content

Commit

Permalink
Issue #71 and #72: Update launcher to better handle catalog files
Browse files Browse the repository at this point in the history
* Update parameters handling to disable "force" when catalog is specified
* Throw an error whenever CLI or config doesn't pick up any targets
  • Loading branch information
jordanpadams committed Aug 17, 2019
1 parent 7e20542 commit 26cfdc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/gov/nasa/pds/validate/ValidateLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public void query(CommandLine line) throws Exception {
setTraverse(false);
} else if (Flag.CATALOG.getShortName().equals(o.getOpt())) {
setCatalogs(o.getValuesList());
setForce(false);
} else if (Flag.SCHEMA.getShortName().equals(o.getOpt())) {
setSchemas(o.getValuesList());
setForce(false);
Expand Down Expand Up @@ -1212,6 +1213,11 @@ private void processMain(String[] args) {
try {
CommandLine cmdLine = parse(args);
query(cmdLine);

if (targets.size() == 0) { // Throw error if no targets are specified
throw new InvalidOptionException("No files specified for validation. Check your paths and use -t flag to explicitly denote the set of target data.");
}

Map<URL, String> checksumManifestMap = new HashMap<URL, String>();
if (checksumManifest != null) {
if (manifestBasePath == null) {
Expand All @@ -1238,7 +1244,6 @@ private void processMain(String[] args) {
}
}
setupReport();

// download the latest Registered Context Products JSON file and
// replace the existing file.
if (updateRegisteredProducts) {
Expand Down

0 comments on commit 26cfdc2

Please sign in to comment.