Skip to content

Commit 2367e95

Browse files
committed
添加多组命令形式
1 parent c6af6a5 commit 2367e95

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

AndroidExecLibrary/src/main/java/com/excellence/exec/CommandTask.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import java.io.BufferedReader;
66
import java.io.InputStreamReader;
7+
import java.util.Arrays;
78
import java.util.List;
89
import java.util.concurrent.Executor;
910
import java.util.concurrent.TimeUnit;
@@ -70,7 +71,7 @@ public static class Builder {
7071
private long mTimeDelay = 0;
7172

7273
/**
73-
* 任务命令
74+
* 任务命令:字符串列表形式
7475
*
7576
* @param command
7677
* @return
@@ -80,6 +81,21 @@ public Builder command(List<String> command) {
8081
return this;
8182
}
8283

84+
/**
85+
* 任务命令:字符串、字符串数组形式
86+
*
87+
* @param command
88+
* @return
89+
*/
90+
public Builder command(String[] command) {
91+
return command(Arrays.asList(command));
92+
}
93+
94+
public Builder command(String command) {
95+
String[] cmd = command.split(" ");
96+
return command(cmd);
97+
}
98+
8399
/**
84100
* 延时、超时的时间单位,默认:ms {@link TimeUnit#MILLISECONDS}
85101
*

0 commit comments

Comments
 (0)