-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
32 lines (28 loc) · 891 Bytes
/
app.js
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
import { program } from "commander";
import { client } from "./client.js";
import { server } from "./server.js";
import { titleScreen } from "./utils.js";
/*
_ _ _ _
| | | | | | | |
| |_ _ _ _ __ _ __ ___| | ___| |__ __ _| |_
| __| | | | '_ \| '_ \ / _ | |/ __| '_ \ / _` | __|
| |_| |_| | | | | | | | __| | (__| | | | (_| | |_
\__|\__,_|_| |_|_| |_|\___|_|\___|_| |_|\__,_|\__|
*/
program
.command("start")
.requiredOption("-p, --port <port>", "Specify the server port")
.action((options) => {
titleScreen();
server(options);
});
program
.command("connect")
.requiredOption("-n, --name <name>", "Specify your nickname")
.requiredOption("-u, --url <url>", "Specify the server URL")
.action((options) => {
titleScreen();
client(options);
});
program.parse(process.argv);