-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
63 lines (58 loc) · 1.34 KB
/
index.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import alfy from "alfy";
import yargsParser from "yargs-parser";
import {
processAll,
processCssClassItems,
processCssVarItems,
processDocItems,
processHTMLSnippets,
processIconItems,
processIconModifierSnippets,
processSubstitutionItems,
processViewItems,
processWebsiteItems,
} from "./getOptions.js";
async function main(args) {
// alfy.log("args", args);
// alfy.log("firstArg", firstArg);
const input = alfy.input;
let items = [];
switch (args.mode) {
case "all":
items = await processAll(input);
break;
case "css-vars":
items = await processCssVarItems(input);
break;
case "css-classes":
items = await processCssClassItems(input);
break;
case "views":
items = await processViewItems(input);
break;
case "icons":
items = await processIconItems(input);
break;
case "icon-modifiers":
items = await processIconModifierSnippets(input);
break;
case "doc":
items = await processDocItems(input);
break;
case "websites":
items = await processWebsiteItems(input);
break;
case "html-snippets":
items = await processHTMLSnippets(input);
break;
case "substitution":
items = await processSubstitutionItems(input);
break;
default:
alfy.error(`Invalid mode: "${args.mode}"`);
break;
}
alfy.output(items);
}
const args = yargsParser(process.argv.slice(2));
await main(args);