Forráskód Böngészése

Make the args of sys.io.Process optional, to support running raw command.

Andy Li 9 éve
szülő
commit
dfdafb68e0

+ 1 - 1
std/cpp/_std/sys/io/Process.hx

@@ -97,7 +97,7 @@ class Process {
 	public var stderr(default,null) : haxe.io.Input;
 	public var stdin(default,null) : haxe.io.Output;
 
-	public function new( cmd : String, args : Array<String> ) : Void {
+	public function new( cmd : String, ?args : Array<String> ) : Void {
 		p = try _run(cmd,args) catch( e : Dynamic ) throw "Process creation failure : "+cmd;
 		stdin = new Stdin(p);
 		stdout = new Stdout(p,true);

+ 1 - 1
std/cs/_std/sys/io/Process.hx

@@ -36,7 +36,7 @@ class Process {
 	private var native:NativeProcess;
 
 
-	public function new( cmd : String, args : Array<String> ) : Void
+	public function new( cmd : String, ?args : Array<String> ) : Void
 	{
 		this.native = new NativeProcess();
 		// mono 4.2.1 on Windows doesn't support relative path correctly

+ 1 - 1
std/java/_std/sys/io/Process.hx

@@ -36,7 +36,7 @@ class Process {
 
 	private var proc:java.lang.Process;
 
-	public function new( cmd : String, args : Array<String> ) : Void
+	public function new( cmd : String, ?args : Array<String> ) : Void
 	{
 		var pargs = new NativeArray(args.length + 1);
 		switch (Sys.systemName()) {

+ 1 - 1
std/neko/_std/sys/io/Process.hx

@@ -92,7 +92,7 @@ private class Stdout extends haxe.io.Input {
 	public var stderr(default,null) : haxe.io.Input;
 	public var stdin(default,null) : haxe.io.Output;
 
-	public function new( cmd : String, args : Array<String> ) : Void {
+	public function new( cmd : String, ?args : Array<String> ) : Void {
 		p = try _run(untyped cmd.__s,neko.Lib.haxeToNeko(args)) catch( e : Dynamic ) throw "Process creation failure : "+cmd;
 		stdin = new Stdin(p);
 		stdout = new Stdout(p,true);

+ 1 - 1
std/php/_std/sys/io/Process.hx

@@ -85,7 +85,7 @@ class Process {
 	public var stderr(default,null) : haxe.io.Input;
 	public var stdin(default,null) : haxe.io.Output;
 
-	public function new( cmd : String, args : Array<String> ) : Void {
+	public function new( cmd : String, ?args : Array<String> ) : Void {
 		var pipes = untyped __call__("array");
 		var descriptorspec = untyped __php__("array(
 			array('pipe', 'r'),

+ 1 - 1
std/python/_std/sys/io/Process.hx

@@ -36,7 +36,7 @@ class Process {
 
 	var p:Popen;
 
-	public function new( cmd : String, args : Array<String> ) : Void {
+	public function new( cmd : String, ?args : Array<String> ) : Void {
 
 		p = Popen.create([cmd].concat(args), { stdin : Subprocess.PIPE, stdout: Subprocess.PIPE, stderr : Subprocess.PIPE });
 

+ 1 - 1
std/sys/io/Process.hx

@@ -27,7 +27,7 @@ extern class Process {
 	var stderr(default,null) : haxe.io.Input;
 	var stdin(default,null) : haxe.io.Output;
 
-	function new( cmd : String, args : Array<String> ) : Void;
+	function new( cmd : String, ?args : Array<String> ) : Void;
 	function getPid() : Int;
 	function exitCode() : Int;
 	function close() : Void;