@@ -39,6 +39,13 @@ export default class Display extends SfdxCommand {
3939
4040 public static examples = messages . getMessage ( 'examples' , [ Display . helpers . join ( ', ' ) ] ) . split ( os . EOL ) ;
4141
42+ public static args = [
43+ {
44+ name : 'plugin' ,
45+ description : messages . getMessage ( 'flags.plugin' ) ,
46+ } ,
47+ ] ;
48+
4249 protected static flagsConfig = {
4350 version : flags . string ( {
4451 char : 'v' ,
@@ -66,9 +73,15 @@ export default class Display extends SfdxCommand {
6673 }
6774
6875 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 ;
7083
71- const infoConfig = await getInfoConfig ( this . config . root ) ;
84+ const infoConfig = await getInfoConfig ( plugin . root ) ;
7285
7386 const { distTagUrl, releaseNotesPath, releaseNotesFilename } = infoConfig . releasenotes ;
7487
@@ -86,15 +99,15 @@ export default class Display extends SfdxCommand {
8699 renderer : new TerminalRenderer ( { emoji : false } ) ,
87100 } ) ;
88101
89- this . ux . log ( marked . parse ( `# Release notes for '${ this . config . bin } ':` ) ) ;
102+ this . ux . log ( marked . parse ( `# Release notes for '${ plugin . name } ':` ) ) ;
90103
91104 this . ux . log ( marked . parser ( tokens ) ) ;
92105
93106 if ( isHook ) {
94107 if ( env . getBoolean ( HIDE_FOOTER ) ) {
95108 await Lifecycle . getInstance ( ) . emitTelemetry ( { eventName : 'FOOTER_HIDDEN' } ) ;
96109 } 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 ] ) ;
98111 this . ux . log ( marked . parse ( footer ) ) ;
99112 }
100113 }
0 commit comments