-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathcli.ts
More file actions
50 lines (44 loc) · 1.37 KB
/
cli.ts
File metadata and controls
50 lines (44 loc) · 1.37 KB
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
/**
* @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.dev/license
*/
import { join } from 'node:path';
import { Argv } from 'yargs';
import {
CommandModule,
CommandModuleImplementation,
CommandScope,
Options,
} from '../../command-builder/command-module';
import {
addCommandModuleToYargs,
demandCommandFailureMessage,
} from '../../command-builder/utilities/command';
import { CacheCleanModule } from './clean/cli';
import { CacheInfoCommandModule } from './info/cli';
import { CacheDisableModule, CacheEnableModule } from './settings/cli';
export default class CacheCommandModule
extends CommandModule
implements CommandModuleImplementation
{
command = 'cache';
describe = 'Configure persistent disk cache and retrieve cache statistics.';
longDescriptionPath = join(__dirname, 'long-description.md');
override scope = CommandScope.In;
builder(localYargs: Argv): Argv {
const subcommands = [
CacheEnableModule,
CacheDisableModule,
CacheCleanModule,
CacheInfoCommandModule,
].sort();
for (const module of subcommands) {
addCommandModuleToYargs(module, this.context);
}
return localYargs.demandCommand(1, demandCommandFailureMessage).strict();
}
run(_options: Options<{}>): void {}
}