* 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
This commit is contained in:
stigkj committed 2009-10-27 00:10:56 +00:00
1 parent 0aadd63ea5
commit 58b535c33a
1 file changed
+3 -3
@@ -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);