@@ -27,17 +27,21 @@ import (
2727
2828func initListCommand () * cobra.Command {
2929 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" ,
3534 Args : cobra .NoArgs ,
3635 Run : runListCommand ,
3736 }
37+ listCommand .Flags ().BoolVar (& listFlags .updatableOnly , "updatable" , false , "List updatable platforms." )
3838 return listCommand
3939}
4040
41+ var listFlags struct {
42+ updatableOnly bool
43+ }
44+
4145func runListCommand (cmd * cobra.Command , args []string ) {
4246 logrus .Info ("Executing `arduino core list`" )
4347
@@ -47,6 +51,9 @@ func runListCommand(cmd *cobra.Command, args []string) {
4751 for _ , targetPackage := range pm .GetPackages ().Packages {
4852 for _ , platform := range targetPackage .Platforms {
4953 if platformRelease := platform .GetInstalled (); platformRelease != nil {
54+ if listFlags .updatableOnly && platform .GetLatestRelease () == platformRelease {
55+ continue
56+ }
5057 res = append (res , platformRelease )
5158 }
5259 }
0 commit comments