@@ -113,21 +113,41 @@ func (res result) String() string {
113113
114114 var out strings.Builder
115115
116- for _ , lsr := range results {
117- out .WriteString (fmt .Sprintf ("Name: \" %s\" \n " , lsr .Name ))
116+ for _ , lib := range results {
117+ out .WriteString (fmt .Sprintf ("Name: \" %s\" \n " , lib .Name ))
118118 if res .namesOnly {
119119 continue
120120 }
121121
122- out .WriteString (fmt .Sprintf (" Author: %s\n " , lsr .GetLatest ().Author ))
123- out .WriteString (fmt .Sprintf (" Maintainer: %s\n " , lsr .GetLatest ().Maintainer ))
124- out .WriteString (fmt .Sprintf (" Sentence: %s\n " , lsr .GetLatest ().Sentence ))
125- out .WriteString (fmt .Sprintf (" Paragraph: %s\n " , lsr .GetLatest ().Paragraph ))
126- out .WriteString (fmt .Sprintf (" Website: %s\n " , lsr .GetLatest ().Website ))
127- out .WriteString (fmt .Sprintf (" Category: %s\n " , lsr .GetLatest ().Category ))
128- out .WriteString (fmt .Sprintf (" Architecture: %s\n " , strings .Join (lsr .GetLatest ().Architectures , ", " )))
129- out .WriteString (fmt .Sprintf (" Types: %s\n " , strings .Join (lsr .GetLatest ().Types , ", " )))
130- out .WriteString (fmt .Sprintf (" Versions: %s\n " , strings .Replace (fmt .Sprint (versionsFromSearchedLibrary (lsr )), " " , ", " , - 1 )))
122+ latest := lib .GetLatest ()
123+
124+ deps := []string {}
125+ for _ , dep := range latest .GetDependencies () {
126+ if dep .GetVersionConstraint () == "" {
127+ deps = append (deps , dep .GetName ())
128+ } else {
129+ deps = append (deps , dep .GetName ()+ " (" + dep .GetVersionConstraint ()+ ")" )
130+ }
131+ }
132+
133+ out .WriteString (fmt .Sprintf (" Author: %s\n " , latest .Author ))
134+ out .WriteString (fmt .Sprintf (" Maintainer: %s\n " , latest .Maintainer ))
135+ out .WriteString (fmt .Sprintf (" Sentence: %s\n " , latest .Sentence ))
136+ out .WriteString (fmt .Sprintf (" Paragraph: %s\n " , latest .Paragraph ))
137+ out .WriteString (fmt .Sprintf (" Website: %s\n " , latest .Website ))
138+ if latest .License != "" {
139+ out .WriteString (fmt .Sprintf (" License: %s\n " , latest .License ))
140+ }
141+ out .WriteString (fmt .Sprintf (" Category: %s\n " , latest .Category ))
142+ out .WriteString (fmt .Sprintf (" Architecture: %s\n " , strings .Join (latest .Architectures , ", " )))
143+ out .WriteString (fmt .Sprintf (" Types: %s\n " , strings .Join (latest .Types , ", " )))
144+ out .WriteString (fmt .Sprintf (" Versions: %s\n " , strings .Replace (fmt .Sprint (versionsFromSearchedLibrary (lib )), " " , ", " , - 1 )))
145+ if len (latest .ProvidesIncludes ) > 0 {
146+ out .WriteString (fmt .Sprintf (" Provides includes: %s\n " , strings .Join (latest .ProvidesIncludes , ", " )))
147+ }
148+ if len (latest .Dependencies ) > 0 {
149+ out .WriteString (fmt .Sprintf (" Dependencies: %s\n " , strings .Join (deps , ", " )))
150+ }
131151 }
132152
133153 return fmt .Sprintf ("%s" , out .String ())
0 commit comments