use of org.parosproxy.paros.extension.CommandLineArgument in project zaproxy by zaproxy.
the class ExtensionReport method execute.
@Override
public void execute(CommandLineArgument[] args) {
if (arguments[ARG_LAST_SCAN_REPORT_IDX].isEnabled()) {
CommandLineArgument arg = arguments[ARG_LAST_SCAN_REPORT_IDX];
ReportLastScan report = new ReportLastScan();
// ZAP: Removed unnecessary cast.
String fileName = arg.getArguments().get(0);
try {
report.generate(fileName, getModel(), "xml/report.html.xsl");
CommandLine.info("Last Scan Report generated at " + fileName);
} catch (Exception e) {
CommandLine.error(e.getMessage(), e);
}
} else {
return;
}
}
use of org.parosproxy.paros.extension.CommandLineArgument in project zaproxy by zaproxy.
the class ExtensionDynSSL method getCommandLineArguments.
private CommandLineArgument[] getCommandLineArguments() {
arguments[ARG_CERT_LOAD] = new CommandLineArgument("-certload", 1, null, "", "-certload <path> " + Constant.messages.getString("dynssl.cmdline.certload"));
arguments[ARG_CERT_PUB_DUMP] = new CommandLineArgument("-certpubdump", 1, null, "", "-certpubdump <path> " + Constant.messages.getString("dynssl.cmdline.certpubdump"));
arguments[ARG_CERT_FULL_DUMP] = new CommandLineArgument("-certfulldump", 1, null, "", "-certfulldump <path> " + Constant.messages.getString("dynssl.cmdline.certfulldump"));
return arguments;
}
use of org.parosproxy.paros.extension.CommandLineArgument in project zaproxy by zaproxy.
the class ExtensionAutoUpdate method getCommandLineArguments.
private CommandLineArgument[] getCommandLineArguments() {
arguments[ARG_CFU_INSTALL_IDX] = new CommandLineArgument("-addoninstall", 1, null, "", "-addoninstall <addOnId> " + Constant.messages.getString("cfu.cmdline.install.help"));
arguments[ARG_CFU_INSTALL_ALL_IDX] = new CommandLineArgument("-addoninstallall", 0, null, "", "-addoninstallall " + Constant.messages.getString("cfu.cmdline.installall.help"));
arguments[ARG_CFU_UNINSTALL_IDX] = new CommandLineArgument("-addonuninstall", 1, null, "", "-addonuninstall <addOnId> " + Constant.messages.getString("cfu.cmdline.uninstall.help"));
arguments[ARG_CFU_UPDATE_IDX] = new CommandLineArgument("-addonupdate", 0, null, "", "-addonupdate " + Constant.messages.getString("cfu.cmdline.update.help"));
arguments[ARG_CFU_LIST_IDX] = new CommandLineArgument("-addonlist", 0, null, "", "-addonlist " + Constant.messages.getString("cfu.cmdline.list.help"));
return arguments;
}
use of org.parosproxy.paros.extension.CommandLineArgument in project zaproxy by zaproxy.
the class CommandLineUnitTest method claWithMissingArgs.
@Test
void claWithMissingArgs() throws Exception {
cmdLine = new CommandLine(new String[] { "-a", "aaa", "-b", "bbb" });
Vector<CommandLineArgument[]> customArguments = new Vector<>();
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-a", 1, null, null, null) });
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-b", 2, null, null, null) });
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-c", 3, null, null, null) });
assertThrows(Exception.class, () -> cmdLine.parse(customArguments, NO_SUPPORTED_FILE_EXTENSIONS));
}
use of org.parosproxy.paros.extension.CommandLineArgument in project zaproxy by zaproxy.
the class CommandLineUnitTest method claWithoutArgs.
@Test
void claWithoutArgs() throws Exception {
cmdLine = new CommandLine(new String[] { "-a", "-b" });
Vector<CommandLineArgument[]> customArguments = new Vector<>();
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-a", 0, null, null, null) });
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-b", 0, null, null, null) });
customArguments.add(new CommandLineArgument[] { new CommandLineArgument("-c", 0, null, null, null) });
cmdLine.parse(customArguments, NO_SUPPORTED_FILE_EXTENSIONS);
assertTrue(customArguments.get(0)[0].isEnabled());
assertTrue(customArguments.get(1)[0].isEnabled());
assertFalse(customArguments.get(2)[0].isEnabled());
}
Aggregations