/
index.js
60 lines (56 loc) · 1.68 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
"use strict";
const dedent = require("dedent");
const getFilteredPackages = require("./lib/get-filtered-packages");
module.exports = filterOptions;
module.exports.getFilteredPackages = getFilteredPackages;
function filterOptions(yargs) {
// Only for 'run', 'exec', 'clean', 'ls', and 'bootstrap' commands
const opts = {
scope: {
describe: "Include only packages with names matching the given glob.",
type: "string",
requiresArg: true,
},
ignore: {
describe: "Exclude packages with names matching the given glob.",
type: "string",
requiresArg: true,
},
"no-private": {
describe: 'Exclude packages with { "private": true } in their package.json.',
type: "boolean",
},
private: {
// proxy for --no-private
hidden: true,
type: "boolean",
},
since: {
describe: dedent`
Only include packages that have been updated since the specified [ref].
If no ref is passed, it defaults to the most-recent tag.
`,
type: "string",
},
"include-filtered-dependents": {
describe: dedent`
Include all transitive dependents when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
"include-filtered-dependencies": {
describe: dedent`
Include all transitive dependencies when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
"continue-if-no-match": {
describe: "Don't fail if no package is matched",
hidden: true,
type: "boolean",
},
};
return yargs.options(opts).group(Object.keys(opts), "Filter Options:");
}