forked from lerna/lerna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (52 loc) · 1.43 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
"use strict";
const os = require("os");
module.exports.globalOptions = globalOptions;
function globalOptions(yargs) {
// the global options applicable to _every_ command
const opts = {
loglevel: {
defaultDescription: "info",
describe: "What level of logs to report.",
type: "string",
},
concurrency: {
defaultDescription: os.cpus().length,
describe: "How many processes to use when lerna parallelizes tasks.",
type: "number",
requiresArg: true,
},
"reject-cycles": {
describe: "Fail if a cycle is detected among dependencies.",
type: "boolean",
},
"no-progress": {
describe: "Disable progress bars. (Always off in CI)",
type: "boolean",
},
progress: {
// proxy for --no-progress
hidden: true,
type: "boolean",
},
"no-sort": {
describe: "Do not sort packages topologically (dependencies before dependents).",
type: "boolean",
},
sort: {
// proxy for --no-sort
hidden: true,
type: "boolean",
},
"max-buffer": {
describe: "Set max-buffer (in bytes) for subcommand execution",
type: "number",
requiresArg: true,
},
};
// group options under "Global Options:" header
const globalKeys = Object.keys(opts).concat(["help", "version"]);
return yargs.options(opts).group(globalKeys, "Global Options:").option("ci", {
hidden: true,
type: "boolean",
});
}