|
@@ -88,12 +88,32 @@ public class SimpleShell {
|
88
|
88
|
|
89
|
89
|
// messages
|
90
|
90
|
if (list.contains("messages")) {
|
91
|
|
- String results = webber.get_messages();
|
92
|
|
- SimpleShell.prettyPrint(results);
|
|
91
|
+ if(list.size() == 1) {
|
|
92
|
+ String results = webber.get_messages();
|
|
93
|
+ SimpleShell.prettyPrint(results);
|
|
94
|
+ } else if (list.size() == 2){
|
|
95
|
+ String results = webber.get_messages(list.get(1));
|
|
96
|
+ SimpleShell.prettyPrint(results);
|
|
97
|
+ } else if (list.size() == 3){
|
|
98
|
+ String results = webber.get_messages(list.get(1), list.get(2));
|
|
99
|
+ SimpleShell.prettyPrint(results);
|
|
100
|
+ }
|
|
101
|
+ continue;
|
|
102
|
+ }
|
|
103
|
+ // send
|
|
104
|
+
|
|
105
|
+ if(list.contains("send")){
|
|
106
|
+ if(list.size() == 3){
|
|
107
|
+ Message msg = new Message("-", list.get(1), "", list.get(2));
|
|
108
|
+ String response = webber.post_messages(msg);
|
|
109
|
+ SimpleShell.prettyPrint(response);
|
|
110
|
+ } else if (list.size() == 4){
|
|
111
|
+ Message msg = new Message("-", list.get(1), list.get(2), list.get(3));
|
|
112
|
+ String response = webber.post_messages(msg);
|
|
113
|
+ SimpleShell.prettyPrint(response);
|
|
114
|
+ }
|
93
|
115
|
continue;
|
94
|
116
|
}
|
95
|
|
- // you need to add a bunch more.
|
96
|
|
-
|
97
|
117
|
//!! command returns the last command in history
|
98
|
118
|
if (list.get(list.size() - 1).equals("!!")) {
|
99
|
119
|
pb.command(history.get(history.size() - 2));
|