forked from NucleoidAI/Nucleoid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bin.js
43 lines (43 loc) · 1.07 KB
/
bin.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
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env node
require("yargs")
.scriptName("nucleoid")
.command({
command: "start",
desc: "Start Nucleoid runtime",
builder: (yargs) =>
yargs
.option("id", {
describe: "Set id for the runtime",
})
.option("clear", {
describe: "Clear data before starting the runtime",
})
.option("silence", {
describe: "Silence the console",
})
.option("debug", {
describe: "Enable debug mode",
})
.option("cluster", {
describe: "Enable cluster mode",
})
.option("terminal-port", {
describe: "Set terminal port number",
})
.option("cluster-port", {
describe: "Set cluster port number",
}),
handler: () => require("./server"),
})
.command({
command: "clear",
desc: "Clear data",
builder: () => {},
handler: () => {
const datastore = require("./src/datastore");
datastore.clear();
console.log("Data is cleared");
},
})
.demandCommand()
.argv.toString();