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
2
2
3
3
import (
4
4
"errors"
5
+ "fmt"
5
6
"os"
7
+ "path/filepath"
6
8
"strings"
7
9
8
10
"github.com/lima-vm/lima/pkg/store/dirnames"
@@ -23,10 +25,30 @@ func main() {
23
25
}
24
26
25
27
func 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
+
26
35
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 ),
30
52
SilenceUsage : true ,
31
53
SilenceErrors : true ,
32
54
}
You can’t perform that action at this time.
0 commit comments