-
Notifications
You must be signed in to change notification settings - Fork 1
/
cli
executable file
·47 lines (40 loc) · 1.09 KB
/
cli
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
"use strict";
const meow = require("meow");
const chalk = require("chalk");
const orianePageSpeedChecker = require("./cli");
const { testA11y } = require("./src/a11y/test_runner");
const cli = meow(`
Usage
$ oriane <test_type> <url>
Test Type
a11y accessibility test
For performance test simply use
$ osr <url>
For more details see
$ osr --help
Example
$ oriane a11y https://example.com
`);
if (!cli.input[0] && !cli.input[1]) {
console.log(chalk.green("Usage: oriane <test_type> <URL>"));
console.log(
chalk.blue(
"Test Type:\n a11y\t accessibility test\n\nFor performance test simply use\n\t$ osr\nFor more details see\n\t$ osr --help"
)
);
process.exit(1);
}
if (!cli.input[1]) {
console.error("Specify a url");
console.log(chalk.green("Usage: oriane <test_type> <URL>"));
console.log(
chalk.blue(
"Test Type:\n a11y\t accessibility test\n\nFor performance test simply use\n\t$ osr\nFor more details see\n\t$ osr --help"
)
);
process.exit(1);
}
if (cli.input[0] === "a11y") {
testA11y(cli.input[1]);
}