@@ -79,7 +79,7 @@ func (o *PluginListOptions) Run() error {
7979
8080 pluginWarnings := 0
8181 for _ , pluginPath := range plugins {
82- fmt .Fprintf (o .Out , "%s \n " , pluginPath )
82+ fmt .Fprintf (o .Out , "%-40s (%s) \n " , pluginToCommand ( pluginPath ), filepath . Dir ( pluginPath ) )
8383 if errs := o .Verifier .Verify (pluginPath ); len (errs ) != 0 {
8484 for _ , err := range errs {
8585 fmt .Fprintf (o .ErrOut , " - %s\n " , err )
@@ -120,7 +120,6 @@ func (o *PluginListOptions) ListPlugins() ([]string, []error) {
120120 if err != nil {
121121 var pathErr * os.PathError
122122 if errors .As (err , & pathErr ) {
123- fmt .Fprintf (o .ErrOut , "Unable to read directory %q from your PATH: %v. Skipping...\n " , dir , err )
124123 continue
125124 }
126125
@@ -235,3 +234,14 @@ func hasValidPrefix(filename string) bool {
235234 }
236235 return false
237236}
237+
238+ func pluginToCommand (pluginPath string ) string {
239+ name := filepath .Base (pluginPath )
240+ name = strings .TrimPrefix (name , PluginPrefix + "-" )
241+ parts := strings .Split (name , "-" )
242+ for i , p := range parts {
243+ parts [i ] = strings .ReplaceAll (p , "_" , "-" )
244+ }
245+ return PluginPrefix + " " + strings .Join (parts , " " )
246+ }
247+
0 commit comments