All Downloads are FREE. Search and download functionalities are using the official Maven repository.

grails.plugin.springsecurity.CommandLineHelper.groovy Maven / Gradle / Ivy

Go to download

The Spring Security plugin simplifies the integration of Spring Security into Grails® framework applications.

The newest version!
package grails.plugin.springsecurity

import grails.dev.commands.ExecutionContext
import org.grails.build.parsing.CommandLine

trait CommandLineHelper {

    static final boolean SUCCESS = true
    static final boolean FAILURE = false

    abstract ExecutionContext getExecutionContext()

    boolean isFlagPresent(String name) {
        final CommandLine commandLine = executionContext.commandLine
        if (commandLine.hasOption(name)) {
            return commandLine.optionValue(name) ? true : false
        } else {
            def value = commandLine?.undeclaredOptions?.get(name)
            return value ? true : false
        }
    }

    String flagValue(String name) {
        final CommandLine commandLine = executionContext.commandLine
        if (commandLine.hasOption(name)) {
            return commandLine.optionValue(name)
        } else {
            def value = commandLine?.undeclaredOptions?.get(name)
            return value
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy