@@ -27,17 +27,21 @@ import (
27
27
28
28
func initListCommand () * cobra.Command {
29
29
listCommand := & cobra.Command {
30
- Use : "list" ,
31
- Short : "Shows the list of installed cores." ,
32
- Long : "Shows the list of installed cores.\n " +
33
- "With -v tag (up to 2 times) can provide more verbose output." ,
34
- Example : " " + commands .AppName + "core list -v # for a medium verbosity level." ,
30
+ Use : "list" ,
31
+ Short : "Shows the list of installed platforms." ,
32
+ Long : "Shows the list of installed platforms." ,
33
+ Example : " " + commands .AppName + "core list" ,
35
34
Args : cobra .NoArgs ,
36
35
Run : runListCommand ,
37
36
}
37
+ listCommand .Flags ().BoolVar (& listFlags .updatableOnly , "updatable" , false , "List updatable platforms." )
38
38
return listCommand
39
39
}
40
40
41
+ var listFlags struct {
42
+ updatableOnly bool
43
+ }
44
+
41
45
func runListCommand (cmd * cobra.Command , args []string ) {
42
46
logrus .Info ("Executing `arduino core list`" )
43
47
@@ -47,6 +51,9 @@ func runListCommand(cmd *cobra.Command, args []string) {
47
51
for _ , targetPackage := range pm .GetPackages ().Packages {
48
52
for _ , platform := range targetPackage .Platforms {
49
53
if platformRelease := platform .GetInstalled (); platformRelease != nil {
54
+ if listFlags .updatableOnly && platform .GetLatestRelease () == platformRelease {
55
+ continue
56
+ }
50
57
res = append (res , platformRelease )
51
58
}
52
59
}
0 commit comments