|
@@ -15,8 +15,8 @@ public class SimpleShell {
|
15
|
15
|
ObjectMapper mapper = new ObjectMapper();
|
16
|
16
|
try {
|
17
|
17
|
Object json = mapper.readValue(output, Object.class);
|
18
|
|
- String indented = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json);
|
19
|
|
- System.out.println(indented);
|
|
18
|
+ String prettyPrintSets = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json);
|
|
19
|
+ System.out.println(prettyPrintSets);
|
20
|
20
|
} catch (IOException e) {
|
21
|
21
|
e.printStackTrace();
|
22
|
22
|
}
|
|
@@ -83,6 +83,28 @@ public class SimpleShell {
|
83
|
83
|
}
|
84
|
84
|
// you need to add a bunch more.
|
85
|
85
|
|
|
86
|
+ if (list.contains("messages") && list.size() == 2) {
|
|
87
|
+ String myGithub = list.get(1);
|
|
88
|
+ String results = webber.MakeURLCall("/ids/" + myGithub + "/messages",
|
|
89
|
+ "GET", "");
|
|
90
|
+ SimpleShell.prettyPrint(results);
|
|
91
|
+ continue;
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ if (list.contains("send")) {
|
|
95
|
+ String groupedMessage = "";
|
|
96
|
+ if (list.get(list.size()-2).equals("to"));
|
|
97
|
+ for (int i = 2; i < list.size()-2; i++) {
|
|
98
|
+ groupedMessage += list.get(i) + " ";
|
|
99
|
+ }
|
|
100
|
+ String trimmedMessage = groupedMessage.trim();
|
|
101
|
+ Message newMessage = new Message(list.get(1), list.get(list.size()-1), trimmedMessage);
|
|
102
|
+ String newMessageInfo = objectMapper.writeValueAsString(newMessage);
|
|
103
|
+ webber.MakeURLCall("/ids/" + list.get(1) + "/messages", "POST", newMessageInfo);
|
|
104
|
+ SimpleShell.prettyPrint(newMessageInfo);
|
|
105
|
+ continue;
|
|
106
|
+ }
|
|
107
|
+
|
86
|
108
|
if (list.contains("ids") && list.size() == 3) {
|
87
|
109
|
String name = list.get(1);
|
88
|
110
|
String gitHubId = list.get(2);
|