提交 8c95d320 编写于 作者: K Kohsuke Kawaguchi

added another convenience method

上级 29589ba5
......@@ -25,6 +25,7 @@ package hudson;
import hudson.Proc.LocalProc;
import hudson.model.Computer;
import hudson.util.QuotedStringTokenizer;
import jenkins.model.Jenkins;
import hudson.model.TaskListener;
import hudson.model.Node;
......@@ -159,6 +160,14 @@ public abstract class Launcher {
*/
protected boolean reverseStdin, reverseStdout, reverseStderr;
/**
* Passes a white-space separated single-string command (like "cat abc def") and parse them
* as a command argument. This method also handles quotes.
*/
public ProcStarter cmdAsSingleString(String s) {
return cmds(QuotedStringTokenizer.tokenize(s));
}
public ProcStarter cmds(String... args) {
return cmds(Arrays.asList(args));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册