Skip to content

Commit

Permalink
make arg parsing a bit more sane
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Oct 17, 2024
1 parent 9948e1e commit 5b7edd2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/gov/nasa/pds/harvest/HarvestCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void run(String[] args)
if(args.length == 0)
{
printHelp();
System.exit(0);
System.exit(1);
}

// Version
Expand All @@ -61,16 +61,20 @@ public void run(String[] args)
System.exit(0);
}

for (String arg : args) {
if ("-h".equalsIgnoreCase(arg) || "-help".equalsIgnoreCase(arg) || "--help".equalsIgnoreCase(arg) || "?".equalsIgnoreCase(arg)) {
printHelp();
}
}

if(!parse(args))
{
System.out.println();
printHelp();
System.exit(1);
System.exit(2);
}

if(!runCommand())
{
System.exit(1);
System.exit(3);
}
}

Expand Down

0 comments on commit 5b7edd2

Please sign in to comment.