@@ -39,6 +39,13 @@ export default class Display extends SfdxCommand {
39
39
40
40
public static examples = messages . getMessage ( 'examples' , [ Display . helpers . join ( ', ' ) ] ) . split ( os . EOL ) ;
41
41
42
+ public static args = [
43
+ {
44
+ name : 'plugin' ,
45
+ description : messages . getMessage ( 'flags.plugin' ) ,
46
+ } ,
47
+ ] ;
48
+
42
49
protected static flagsConfig = {
43
50
version : flags . string ( {
44
51
char : 'v' ,
@@ -66,9 +73,15 @@ export default class Display extends SfdxCommand {
66
73
}
67
74
68
75
try {
69
- const installedVersion = this . config . pjson . version ;
76
+ const plugin = ( this . args . plugin as string )
77
+ ? this . config . plugins . filter ( ( p ) => p . name === ( this . args . plugin as string ) ) [ 0 ]
78
+ : this . config ;
79
+
80
+ if ( ! plugin ) throw new Error ( `No plugin '${ this . args . plugin as string } ' found` ) ;
81
+
82
+ const installedVersion = plugin . pjson . version ;
70
83
71
- const infoConfig = await getInfoConfig ( this . config . root ) ;
84
+ const infoConfig = await getInfoConfig ( plugin . root ) ;
72
85
73
86
const { distTagUrl, releaseNotesPath, releaseNotesFilename } = infoConfig . releasenotes ;
74
87
@@ -86,15 +99,15 @@ export default class Display extends SfdxCommand {
86
99
renderer : new TerminalRenderer ( { emoji : false } ) ,
87
100
} ) ;
88
101
89
- this . ux . log ( marked . parse ( `# Release notes for '${ this . config . bin } ':` ) ) ;
102
+ this . ux . log ( marked . parse ( `# Release notes for '${ plugin . name } ':` ) ) ;
90
103
91
104
this . ux . log ( marked . parser ( tokens ) ) ;
92
105
93
106
if ( isHook ) {
94
107
if ( env . getBoolean ( HIDE_FOOTER ) ) {
95
108
await Lifecycle . getInstance ( ) . emitTelemetry ( { eventName : 'FOOTER_HIDDEN' } ) ;
96
109
} else {
97
- const footer = messages . getMessage ( 'footer' , [ this . config . bin , releaseNotesPath , HIDE_NOTES , HIDE_FOOTER ] ) ;
110
+ const footer = messages . getMessage ( 'footer' , [ plugin . name , releaseNotesPath , HIDE_NOTES , HIDE_FOOTER ] ) ;
98
111
this . ux . log ( marked . parse ( footer ) ) ;
99
112
}
100
113
}
0 commit comments