77
88import { asString , Dictionary , ensureJsonMap , ensureObject , ensureString , JsonMap } from '@salesforce/ts-types' ;
99import { join } from 'path' ;
10- import { helpFromDescription , punctuate } from '../utils' ;
10+ import { events , helpFromDescription , punctuate } from '../utils' ;
1111import { Ditamap } from './ditamap' ;
1212
1313export type CommandHelpInfo = {
@@ -33,7 +33,12 @@ export class Command extends Ditamap {
3333 const description = punctuate ( asString ( command . longDescription ) || asString ( command . description ) ) ;
3434 // Help are all the lines after the first line in the description. Before oclif, there was a 'help' property so continue to
3535 // 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 ) ) ;
3742 let trailblazerCommunityUrl ;
3843 let trailblazerCommunityName ;
3944
@@ -43,17 +48,10 @@ export class Command extends Ditamap {
4348 trailblazerCommunityName = community . name ;
4449 }
4550
46- let fullName : string ;
47- if ( subtopic ) {
48- fullName = commandWithUnderscores . replace ( `${ topic } _${ subtopic } _` , '' ) ;
49- } else {
50- fullName = commandWithUnderscores . replace ( `${ topic } _` , '' ) ;
51- }
5251 const state = command . state || commandMeta . state ;
5352 this . data = Object . assign ( command , {
5453 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,
5755 help,
5856 description,
5957 parameters,
0 commit comments