From 58b535c33ad144a14d959d312c8104f4ea4fc5f7 Mon Sep 17 00:00:00 2001 From: stigkj Date: Tue, 27 Oct 2009 00:10:56 +0000 Subject: [PATCH] * 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 --- core/src/main/java/hudson/cli/GroovyCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/cli/GroovyCommand.java b/core/src/main/java/hudson/cli/GroovyCommand.java index a941058165..32c05da645 100644 --- a/core/src/main/java/hudson/cli/GroovyCommand.java +++ b/core/src/main/java/hudson/cli/GroovyCommand.java @@ -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() { public String call() throws IOException { - if(script.equals("-")) + if(script.equals("=")) return IOUtils.toString(System.in); File f = new File(script); -- GitLab