Skip to content

Commit

Permalink
tmp is an option
Browse files Browse the repository at this point in the history
  • Loading branch information
nikololiahim committed Mar 24, 2022
1 parent dfdb402 commit 05808ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/org/polystat/Polystat.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com.jcabi.log.Logger;
import com.jcabi.manifests.Manifests;
import com.jcabi.xml.XML;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -81,9 +83,10 @@ public final class Polystat implements Callable<Integer> {
/**
* Output directoty.
*/
@CommandLine.Parameters(
index = "1",
description = "The directory with .XML files and maybe other temp."
@CommandLine.Option(
names = "--tmp",
description = "The directory with .XML files and maybe other temp." +
"If not specified, defaults to a temporary directory."
)
private Path temp;

Expand All @@ -110,8 +113,9 @@ public static void main(final String... args) throws Exception {

@Override
public Integer call() throws Exception {
final Path tmpDir = this.temp == null ? Files.createTempDirectory("polystat_tmp") : this.temp;
final Iterable<Result> errors =
Polystat.scan(this.source, this.temp);
Polystat.scan(this.source, tmpDir);
final Supplier<String> out;
if (this.sarif) {
out = new AsSarif(errors);
Expand Down

0 comments on commit 05808ae

Please sign in to comment.