7
7
8
8
import { asString , Dictionary , ensureJsonMap , ensureObject , ensureString , JsonMap } from '@salesforce/ts-types' ;
9
9
import { join } from 'path' ;
10
- import { helpFromDescription , punctuate } from '../utils' ;
10
+ import { events , helpFromDescription , punctuate } from '../utils' ;
11
11
import { Ditamap } from './ditamap' ;
12
12
13
13
export type CommandHelpInfo = {
@@ -33,7 +33,12 @@ export class Command extends Ditamap {
33
33
const description = punctuate ( asString ( command . longDescription ) || asString ( command . description ) ) ;
34
34
// Help are all the lines after the first line in the description. Before oclif, there was a 'help' property so continue to
35
35
// support that.
36
- const help = this . formatParagraphs ( asString ( command . help ) || helpFromDescription ( asString ( command . description ) ) ) ;
36
+
37
+ if ( ! description ) {
38
+ events . emit ( 'warning' , `Missing description for ${ command . id } \n` ) ;
39
+ }
40
+
41
+ const help = this . formatParagraphs ( asString ( command . help ) || helpFromDescription ( description ) ) ;
37
42
let trailblazerCommunityUrl ;
38
43
let trailblazerCommunityName ;
39
44
@@ -43,17 +48,10 @@ export class Command extends Ditamap {
43
48
trailblazerCommunityName = community . name ;
44
49
}
45
50
46
- let fullName : string ;
47
- if ( subtopic ) {
48
- fullName = commandWithUnderscores . replace ( `${ topic } _${ subtopic } _` , '' ) ;
49
- } else {
50
- fullName = commandWithUnderscores . replace ( `${ topic } _` , '' ) ;
51
- }
52
51
const state = command . state || commandMeta . state ;
53
52
this . data = Object . assign ( command , {
54
53
binary : 'sfdx' ,
55
- // The old style didn't have the topic or subtopic in the reference ID.
56
- full_name_with_underscores : fullName ,
54
+ commandWithUnderscores,
57
55
help,
58
56
description,
59
57
parameters,
0 commit comments