Extend programming model for script commands
This commit is contained in:
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.test.command
|
||||
|
||||
import joptsimple.OptionSet
|
||||
|
||||
@Grab("org.eclipse.jgit:org.eclipse.jgit:2.3.1.201302201838-r")
|
||||
import org.eclipse.jgit.api.Git
|
||||
|
||||
|
||||
class TestCommand extends OptionHandler {
|
||||
|
||||
String name = "foo"
|
||||
|
||||
void options() {
|
||||
option "foo", "Foo set"
|
||||
@@ -30,7 +30,7 @@ class TestCommand extends OptionHandler {
|
||||
|
||||
void run(OptionSet options) {
|
||||
// Demonstrate use of Grape.grab to load dependencies before running
|
||||
println "Clean : " + Git.open(".." as File).status().call().isClean()
|
||||
println "Clean: " + Git.open(".." as File).status().call().isClean()
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user