-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear out command line logic until API module logic is fleshed out
- Loading branch information
Showing
1 changed file
with
14 additions
and
26 deletions.
There are no files selected for viewing
40 changes: 14 additions & 26 deletions
40
concoction-app/src/main/java/info/mmpa/concoction/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
package info.mmpa.concoction; | ||
|
||
import java.io.File; | ||
import java.io.PrintWriter; | ||
import java.util.Map; | ||
import java.util.concurrent.Callable; | ||
|
||
import info.mmpa.concoction.result.ArchiveScanResults; | ||
import info.mmpa.concoction.result.printer.HumanReadablePrinter; | ||
import picocli.CommandLine; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Parameters; | ||
|
||
@Command(name = "Concoction", mixinStandardHelpOptions = true, version = "Concoction v1.0.0", description = "Dynamic Shared Malware Scanner") | ||
public class Main implements Callable<Integer> { | ||
@Parameters(index = "0", description = "The file / directory to scan") | ||
private File file; | ||
import java.util.concurrent.Callable; | ||
|
||
@Override | ||
public Integer call() throws Exception { | ||
Map<String, ArchiveScanResults> results = Concoction.scanDirectory(file); | ||
@Command(name = "Concoction", mixinStandardHelpOptions = true, | ||
version = "Concoction v" + ConcoctionBuildConfig.VERSION, | ||
description = "Dynamic Shared Malware Scanner") | ||
public class Main implements Callable<Integer> { | ||
|
||
if (results.isEmpty()) { | ||
return CommandLine.ExitCode.OK; | ||
} else { | ||
new HumanReadablePrinter(results).print(new PrintWriter(System.out)); | ||
return 1; | ||
} | ||
} | ||
@Override | ||
public Integer call() throws Exception { | ||
// TODO: Reimplement once the core library API solidifies | ||
return 0; | ||
} | ||
|
||
public static void main(String[] args) { | ||
final int exitCode = new CommandLine(new Main()).execute(args); | ||
System.exit(exitCode); | ||
} | ||
public static void main(String[] args) { | ||
final int exitCode = new CommandLine(new Main()).execute(args); | ||
System.exit(exitCode); | ||
} | ||
} |