提交 58b535c3 编写于 作者: S stigkj

* Fixed error when using stdin as "-" is parsed by args4j which does not understand it;

  replaced it with "="
* Hardcoded name of script as "=" or something like "not-a-good-script-name.groovy" failed

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23228 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0aadd63e
......@@ -56,7 +56,7 @@ public class GroovyCommand extends CLICommand implements Serializable {
return "Executes the specified Groovy script";
}
@Argument(metaVar="SCRIPT",usage="Script to be executed. File, URL or '-' to represent stdin.")
@Argument(metaVar="SCRIPT",usage="Script to be executed. File, URL or '=' to represent stdin.")
public String script;
/**
......@@ -72,7 +72,7 @@ public class GroovyCommand extends CLICommand implements Serializable {
Binding binding = new Binding();
binding.setProperty("out",new PrintWriter(stdout,true));
GroovyShell groovy = new GroovyShell(binding);
groovy.run(loadScript(),script,remaining.toArray(new String[remaining.size()]));
groovy.run(loadScript(),"RemoteClass",remaining.toArray(new String[remaining.size()]));
return 0;
}
......@@ -84,7 +84,7 @@ public class GroovyCommand extends CLICommand implements Serializable {
throw new CmdLineException("No script is specified");
return channel.call(new Callable<String,IOException>() {
public String call() throws IOException {
if(script.equals("-"))
if(script.equals("="))
return IOUtils.toString(System.in);
File f = new File(script);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册