/
cli.ts
51 lines (45 loc) · 1.38 KB
/
cli.ts
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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { join } from 'node:path';
import { Argv } from 'yargs';
import {
CommandModule,
CommandModuleImplementation,
Options,
} from '../../command-builder/command-module';
import {
addCommandModuleToYargs,
demandCommandFailureMessage,
} from '../../command-builder/utilities/command';
import { AnalyticsInfoCommandModule } from './info/cli';
import {
AnalyticsDisableModule,
AnalyticsEnableModule,
AnalyticsPromptModule,
} from './settings/cli';
export default class AnalyticsCommandModule
extends CommandModule
implements CommandModuleImplementation
{
command = 'analytics';
describe = 'Configures the gathering of Angular CLI usage metrics.';
longDescriptionPath = join(__dirname, 'long-description.md');
builder(localYargs: Argv): Argv {
const subcommands = [
AnalyticsInfoCommandModule,
AnalyticsDisableModule,
AnalyticsEnableModule,
AnalyticsPromptModule,
].sort(); // sort by class name.
for (const module of subcommands) {
localYargs = addCommandModuleToYargs(localYargs, module, this.context);
}
return localYargs.demandCommand(1, demandCommandFailureMessage).strict();
}
run(_options: Options<{}>): void {}
}