【发布时间】:2015-05-18 20:00:14
【问题描述】:
我正在使用 Grails 2.5.0。
给定一个非常简单的 Gant 脚本,如下所示,我将其放入 grails-app/scripts/TestScript.groovy
includeTargets << grailsScript("_GrailsInit")
target(test: "The description of the script goes here!") {
ant.input(addProperty: 'name', message: "What's your name ? ", defaultvalue: 'anonymous')
println "Hello ${ant.antProject.properties.name}"
}
setDefaultTarget(test)
如何使其与 --non-interactive 命令行标志一起使用?
我尝试通过grails test-script 和grails test-script --non-interactive 运行它,两个版本都提示我输入用户输入。
根据documentation,设置 --non-interactive 应该足以使其接受默认值(在这种情况下为匿名),但事实并非如此。
【问题讨论】: