grails.plugin.springsecurity.CommandLineHelper.groovy Maven / Gradle / Ivy
package grails.plugin.springsecurity
import grails.dev.commands.ExecutionContext
import io.micronaut.core.naming.NameUtils
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