-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathShell.java
39 lines (33 loc) · 1.02 KB
/
Shell.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.Scanner;
import java.util.*;
import java.util.stream.Collectors;
public class Shell {
public static void main(String[] _args) {
while (true) {
var line = scanner.nextLine();
System.out.println("$" + line);
var args = line.split(" ");
var cmd = args[0];
if (cmd.equals("end")) {
break;
}
else if (cmd.equals("show")) {
}
else if (cmd.equals("init")) {
// var seats = Integer.parseInt(args[1]);
}
else if (cmd.equals("reserve")) {
// var id = args[1];
// var phone = args[2];
// var index = Integer.parseInt(args[3]);
}
else if (cmd.equals("cancel")) {
// var id = args[1];
}
else {
System.out.println("fail: comando invalido");
}
}
}
private static Scanner scanner = new Scanner(System.in);
}