Search in sources :

Example 1 with CommandLine

use of org.parosproxy.paros.CommandLine in project zaproxy by zaproxy.

the class ZAP method main.

/**
 * Main method
 *
 * @param args the arguments passed to the command line version
 * @throws Exception if something wrong happens
 */
public static void main(String[] args) throws Exception {
    setCustomErrStream();
    CommandLine cmdLine = null;
    try {
        cmdLine = new CommandLine(args != null ? Arrays.copyOf(args, args.length) : null);
    } catch (final Exception e) {
        // Cant use the CommandLine help here as the
        // i18n messages wont have been loaded
        System.out.println("Failed due to invalid parameters: " + Arrays.toString(args));
        System.out.println(e.getMessage());
        System.out.println("Use '-h' for more details.");
        System.exit(1);
    }
    ZapBootstrap bootstrap = createZapBootstrap(cmdLine);
    try {
        int rc = bootstrap.start();
        if (rc != 0) {
            System.exit(rc);
        }
    } catch (final Exception e) {
        logger.fatal(e.getMessage(), e);
        System.exit(1);
    }
}
Also used : CommandLine(org.parosproxy.paros.CommandLine) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 CommandLine (org.parosproxy.paros.CommandLine)1