File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package lib
18
18
import (
19
19
"fmt"
20
20
"os"
21
+ "sort"
21
22
"strings"
22
23
23
24
"github.com/arduino/arduino-cli/cli/errorcodes"
@@ -91,6 +92,10 @@ func (ir libraryExamplesResult) String() string {
91
92
return "No libraries found."
92
93
}
93
94
95
+ sort .Slice (ir .Examples , func (i , j int ) bool {
96
+ return strings .ToLower (ir .Examples [i ].Library .Name ) < strings .ToLower (ir .Examples [j ].Library .Name )
97
+ })
98
+
94
99
res := []string {}
95
100
for _ , lib := range ir .Examples {
96
101
name := lib .Library .Name
@@ -100,6 +105,9 @@ func (ir libraryExamplesResult) String() string {
100
105
name += " (" + lib .Library .GetLocation ().String () + ")"
101
106
}
102
107
r := fmt .Sprintf ("Examples for library %s\n " , color .GreenString ("%s" , name ))
108
+ sort .Slice (lib .Examples , func (i , j int ) bool {
109
+ return strings .ToLower (lib .Examples [i ]) < strings .ToLower (lib .Examples [j ])
110
+ })
103
111
for _ , example := range lib .Examples {
104
112
examplePath := paths .New (example )
105
113
r += fmt .Sprintf (" - %s%s\n " ,
You can’t perform that action at this time.
0 commit comments