<commit_before>package groovyToExeConverter.input

import groovy.util.OptionAccessor as Input
import groovy.util.logging.Log4j
import groovyToExeConverter.input.core.InputParser
import groovyToExeConverter.input.core.InputTransformer
import groovyToExeConverter.input.core.InputValidator
import groovyToExeConverter.input.core.Log4jHandler
import groovyToExeConverter.model.AppConfig
import groovyToExeConverter.util.PropertiesReader

@Log4j
class InputProcessor {

    final inputParser = new InputParser(),
          inputValidator = new InputValidator(),
          inputTransformer = new InputTransformer()

    AppConfig processIntoAppConfig(String[] args) {
        Input input = inputParser.parse(args)

        if (!input || isOneOffCommand(input)) {
            return null
        } else if (input.debug) {
            Log4jHandler.setAppenderToDebugAppender()
        }

        inputValidator.validate(input)
        return inputTransformer.transformIntoAppConfig(input)
    }

    private boolean isOneOffCommand(Input input) {
        if (input.help) {
            inputParser.usage()
            return true
        } else if (input.version) {
            log.info("Version: ${PropertiesReader.readAppProperty("version")}")
            return true
        }

        return false
    }

}<commit_msg>improved handling of one-off commands<commit_after>package groovyToExeConverter.input

import groovy.util.OptionAccessor as Input
import groovy.util.logging.Log4j
import groovyToExeConverter.input.core.InputParser
import groovyToExeConverter.input.core.InputTransformer
import groovyToExeConverter.input.core.InputValidator
import groovyToExeConverter.input.core.Log4jHandler
import groovyToExeConverter.model.AppConfig
import groovyToExeConverter.util.PropertiesReader

@Log4j
class InputProcessor {

    final inputParser = new InputParser(),
          inputValidator = new InputValidator(),
          inputTransformer = new InputTransformer()

    AppConfig processIntoAppConfig(String[] args) {
        Input input = inputParser.parse(args)

        if (!input) {
            return null
        } else if (isOneOffCommand(input)) {
            performOneOffCommand(input)
            return null
        } else if (input.debug) {
            Log4jHandler.setAppenderToDebugAppender()
        }

        inputValidator.validate(input)
        inputTransformer.transformIntoAppConfig(input)
    }

    private static boolean isOneOffCommand(Input input) {
        input.help || input.version
    }

    private void performOneOffCommand(Input input) {
        if (input.help) {
            inputParser.usage()
        } else if (input.version) {
            log.info("Version: ${PropertiesReader.readAppProperty("version")}")
        }
    }

}
{'fraction_non_alphanumeric': 0.07931908728721478, 'fraction_numerical': 0.002897500905469033, 'mean_word_length': 3.1040118870728084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3834541', 'n_tokens_mistral': 772, 'n_tokens_neox': 741, 'n_words': 147}