1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | exports.ReporterCommand = void 0;
|
10 | const core_1 = require("@salesforce/core");
|
11 | const command_1 = require("@salesforce/command");
|
12 | const ToolbeltCommand_1 = require("./ToolbeltCommand");
|
13 | core_1.Messages.importMessagesDirectory(__dirname);
|
14 | const messages = core_1.Messages.loadMessages('salesforce-alm', 'reporterCommand');
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | class ReporterCommand extends ToolbeltCommand_1.ToolbeltCommand {
|
20 | static get flags() {
|
21 | if (!this.flagsConfig) {
|
22 | this.flagsConfig = {};
|
23 | }
|
24 | this.flagsConfig.resultformat = command_1.flags.enum(Object.assign({
|
25 | char: 'r',
|
26 | description: messages.getMessage('ResultFormatDescription'),
|
27 | longDescription: messages.getMessage('ResultFormatLongDescription'),
|
28 | options: ['human', 'csv', 'json']
|
29 | }, this.resultFormatOptions));
|
30 | return super.flags;
|
31 | }
|
32 |
|
33 | async init() {
|
34 | try {
|
35 | const { flags } = this.parse({
|
36 | flags: this.statics.flags,
|
37 | args: this.statics.args
|
38 | });
|
39 |
|
40 | if (flags.resultformat === 'json' && !flags.json) {
|
41 | this.argv.push('--json');
|
42 | }
|
43 | }
|
44 | catch (err) {
|
45 |
|
46 | }
|
47 | return super.init();
|
48 | }
|
49 |
|
50 | get statics() {
|
51 | return this.constructor;
|
52 | }
|
53 | }
|
54 | exports.ReporterCommand = ReporterCommand;
|
55 | ReporterCommand.resultFormatOptions = {};
|
56 |
|
57 |
|