@@ -21,6 +21,7 @@ import (
21
21
"github.com/lima-vm/lima/pkg/limatmpl"
22
22
"github.com/lima-vm/lima/pkg/limayaml"
23
23
networks "github.com/lima-vm/lima/pkg/networks/reconcile"
24
+ "github.com/lima-vm/lima/pkg/registry"
24
25
"github.com/lima-vm/lima/pkg/store"
25
26
"github.com/lima-vm/lima/pkg/store/filenames"
26
27
"github.com/lima-vm/lima/pkg/templatestore"
@@ -32,6 +33,7 @@ func registerCreateFlags(cmd *cobra.Command, commentPrefix string) {
32
33
flags := cmd .Flags ()
33
34
flags .String ("name" , "" , commentPrefix + "Override the instance name" )
34
35
flags .Bool ("list-templates" , false , commentPrefix + "List available templates and exit" )
36
+ flags .Bool ("list-drivers" , false , commentPrefix + "List available drivers and exit" )
35
37
editflags .RegisterCreate (cmd , commentPrefix )
36
38
}
37
39
@@ -54,6 +56,9 @@ $ limactl create --set='.cpus = 2 | .memory = "2GiB"'
54
56
To see the template list:
55
57
$ limactl create --list-templates
56
58
59
+ To see the drivers list:
60
+ $ limactl create --list-drivers
61
+
57
62
To create an instance "default" from a local file:
58
63
$ limactl create --name=default /usr/local/share/lima/templates/fedora.yaml
59
64
@@ -393,6 +398,14 @@ func createStartActionCommon(cmd *cobra.Command, _ []string) (exit bool, err err
393
398
_ , _ = fmt .Fprintln (w , f .Name )
394
399
}
395
400
return true , nil
401
+ } else if listDrivers , err := cmd .Flags ().GetBool ("list-drivers" ); err != nil {
402
+ return true , err
403
+ } else if listDrivers {
404
+ w := cmd .OutOrStdout ()
405
+ for _ , d := range registry .DefaultRegistry .List () {
406
+ _ , _ = fmt .Fprintln (w , d )
407
+ }
408
+ return true , nil
396
409
}
397
410
return false , nil
398
411
}
0 commit comments