private Whisker configure()

in apache-whisker-cli/src/main/java/org/apache/creadur/whisker/cli/Main.java [129:152]


    private Whisker configure(
            final CommandLine commandLine) throws MissingOptionException {
        whisker.setEngine(new LoggingVelocityEngine());
        whisker.setSource(CommandLineOption.SOURCE.getOptionValue(commandLine));
        whisker.setLicenseDescriptor(
                new StreamableResourceFactory().streamFromResource(
                        licenseDescriptorName(commandLine)));
        whisker.setWriterFactory(new WriteResultsToSystemOutFactory());
        if (CommandLineOption.ACT_TO_AUDIT.isSetOn(commandLine)) {
            whisker.setAct(Act.AUDIT);
        } else if (CommandLineOption.ACT_TO_GENERATE.isSetOn(commandLine)) {
            whisker.setAct(Act.GENERATE);
        } else if (CommandLineOption.ACT_TO_SKELETON.isSetOn(commandLine)) {
            whisker.setAct(Act.SKELETON);
        }

        if (whisker.getSource() == null
                && whisker.getAct().isSourceRequired()) {
            throw new MissingOptionException("-"
                    + CommandLineOption.SOURCE.getShortName() + " "
                    + CommandLineOption.SOURCE.getDescription());
        }
        return whisker;
    }