-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (25 loc) · 816 Bytes
/
main.cpp
File metadata and controls
28 lines (25 loc) · 816 Bytes
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
#include <iostream>
#include <zconf.h>
#include "lang/String.h"
#include "util/Scanner.h"
#include "lang/System.h"
#include "util/ArrayList.h"
#include "io/Runtime.h"
#include "net/InetAddress.h"
int main() {
String user = Runtime::exec("whoami");
String address = InetAddress::getExternalAddress();
String prompt = user.append("@").append(address).append(" > ");
Scanner scanner(std::cin);
prompt.replaceAll(prompt.toStdString(), "\n", "");
System::println("Welcome to JavaStyle.\nVersion: 0.0.1");
System::println(Runtime::exec("uname -a"));
System::println(String("LAN: ").append(InetAddress::getLocalAddress()));
System::println(String("WAN: ").append(InetAddress::getExternalAddress()));
while (1)
{
System::print(prompt);
System::println(Runtime::exec(scanner.readline()));
}
return 0;
}