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