File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package main
22
33import (
44 "errors"
5+ "fmt"
56 "os"
7+ "path/filepath"
68 "strings"
79
810 "github.com/lima-vm/lima/pkg/store/dirnames"
@@ -23,10 +25,30 @@ func main() {
2325}
2426
2527func newApp () * cobra.Command {
28+ examplesDir := "$PREFIX/share/doc/lima/examples"
29+ if exe , err := os .Executable (); err == nil {
30+ binDir := filepath .Dir (exe )
31+ prefixDir := filepath .Dir (binDir )
32+ examplesDir = filepath .Join (prefixDir , "share/doc/lima/examples" )
33+ }
34+
2635 var rootCmd = & cobra.Command {
27- Use : "limactl" ,
28- Short : "Lima: Linux virtual machines" ,
29- Version : strings .TrimPrefix (version .Version , "v" ),
36+ Use : "limactl" ,
37+ Short : "Lima: Linux virtual machines" ,
38+ Version : strings .TrimPrefix (version .Version , "v" ),
39+ Example : fmt .Sprintf (` Start the default instance:
40+ $ limactl start
41+
42+ Open a shell:
43+ $ lima
44+
45+ Run a container:
46+ $ lima nerdctl run -d --name nginx -p 8080:80 nginx:alpine
47+
48+ Stop the default instance:
49+ $ limactl stop
50+
51+ See also example YAMLs: %s` , examplesDir ),
3052 SilenceUsage : true ,
3153 SilenceErrors : true ,
3254 }
You can’t perform that action at this time.
0 commit comments