forked from openfun/bbb-stress-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·47 lines (42 loc) · 1.12 KB
/
cli.js
File metadata and controls
executable file
·47 lines (42 loc) · 1.12 KB
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
44
45
46
47
#!/usr/bin/env node
const { getEnv } = require("./lib/command-helpers");
const yargs = require("yargs");
const listMeetings = require("./lib/commands/list-meetings");
const stress = require("./lib/commands/stress");
const defaultBuilder = (yargs) => yargs;
const argv = yargs
.command(
listMeetings.name,
listMeetings.description,
listMeetings.options || defaultBuilder,
listMeetings.handler
)
.command(
stress.name,
stress.description,
stress.options || defaultBuilder,
stress.handler
)
.option("bbb-url", {
alias: "u",
type: "string",
description: "BBB API url",
})
.option("bbb-secret", {
alias: "s",
type: "string",
description: "BBB secret",
})
.option("verbose", {
alias: "v",
type: "boolean",
description: "Run with verbose logging",
})
.default("bbb-url", getEnv("BBB_URL"))
.default("bbb-secret", getEnv("BBB_SECRET"))
.demandOption(
["bbb-url", "bbb-secret"],
"Please provide bbb-secret and bbb-url options. You can find the values by running bbb-conf --secret on your BBB server"
)
.demandCommand(1, "")
.strict().argv;