7: Add --color option to CLI
This commit is contained in:
@@ -14,6 +14,7 @@ public class CliArgsOptions {
|
|||||||
private String apkAuditFile;
|
private String apkAuditFile;
|
||||||
private Set<String> excludes;
|
private Set<String> excludes;
|
||||||
private Set<String> plugins;
|
private Set<String> plugins;
|
||||||
|
private boolean color;
|
||||||
|
|
||||||
public boolean isSourceAnalysis() {
|
public boolean isSourceAnalysis() {
|
||||||
return sourceAnalysisDirectory != null;
|
return sourceAnalysisDirectory != null;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class CliArgsParser {
|
|||||||
private static final String EXCLUDE_OPT = "exclude";
|
private static final String EXCLUDE_OPT = "exclude";
|
||||||
private static final String HELP_OPT = "help";
|
private static final String HELP_OPT = "help";
|
||||||
private static final String PLUGINS_OPT = "plugins";
|
private static final String PLUGINS_OPT = "plugins";
|
||||||
|
private static final String COLOR_OPT = "color";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CliArgsParser() {}
|
public CliArgsParser() {}
|
||||||
@@ -47,6 +48,7 @@ public class CliArgsParser {
|
|||||||
.apkAuditFile(command.hasOption(APK_OPT) ? command.getOptionValue(APK_OPT) : null)
|
.apkAuditFile(command.hasOption(APK_OPT) ? command.getOptionValue(APK_OPT) : null)
|
||||||
.plugins(command.hasOption(PLUGINS_OPT) ? new HashSet<>(asList(command.getOptionValues(PLUGINS_OPT))) : emptySet())
|
.plugins(command.hasOption(PLUGINS_OPT) ? new HashSet<>(asList(command.getOptionValues(PLUGINS_OPT))) : emptySet())
|
||||||
.excludes(command.hasOption(EXCLUDE_OPT) ? new HashSet<>(asList(command.getOptionValues(EXCLUDE_OPT))) : emptySet())
|
.excludes(command.hasOption(EXCLUDE_OPT) ? new HashSet<>(asList(command.getOptionValues(EXCLUDE_OPT))) : emptySet())
|
||||||
|
.color(command.hasOption(COLOR_OPT))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +64,7 @@ public class CliArgsParser {
|
|||||||
options.addOption(exclude());
|
options.addOption(exclude());
|
||||||
options.addOption(plugins());
|
options.addOption(plugins());
|
||||||
options.addOption(help());
|
options.addOption(help());
|
||||||
|
options.addOption(color());
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,4 +110,11 @@ public class CliArgsParser {
|
|||||||
.desc("use only selected security checks for audit/analysis")
|
.desc("use only selected security checks for audit/analysis")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Option color() {
|
||||||
|
return Option.builder()
|
||||||
|
.longOpt(COLOR_OPT)
|
||||||
|
.desc("enable colored output")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user