File tree 3 files changed +12
-8
lines changed
3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ const (
21
21
kcl mod init
22
22
23
23
# Init one kcl module with the name
24
- kcl mod init package-name`
24
+ kcl mod init package-name
25
+
26
+ # Init one kcl module with the name and version
27
+ kcl mod init package-name --version 0.1.0`
25
28
)
26
29
27
30
// NewModInitCmd returns the mod init command.
28
31
func NewModInitCmd (cli * client.KpmClient ) * cobra.Command {
32
+ initOpts := opt.InitOptions {}
29
33
cmd := & cobra.Command {
30
34
Use : "init" ,
31
35
Short : "initialize new module in current directory" ,
@@ -54,10 +58,8 @@ func NewModInitCmd(cli *client.KpmClient) *cobra.Command {
54
58
}
55
59
}
56
60
57
- initOpts := opt.InitOptions {
58
- Name : pkgName ,
59
- InitPath : pkgRootPath ,
60
- }
61
+ initOpts .Name = pkgName
62
+ initOpts .InitPath = pkgRootPath
61
63
62
64
err = initOpts .Validate ()
63
65
if err != nil {
@@ -89,5 +91,7 @@ func NewModInitCmd(cli *client.KpmClient) *cobra.Command {
89
91
SilenceUsage : true ,
90
92
}
91
93
94
+ cmd .Flags ().StringVar (& initOpts .Version , "version" , "" , "init module version" )
95
+
92
96
return cmd
93
97
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require (
10
10
kcl-lang.io/kcl-go v0.8.0
11
11
kcl-lang.io/kcl-openapi v0.6.0
12
12
kcl-lang.io/kcl-playground v0.5.1
13
- kcl-lang.io/kpm v0.8.1
13
+ kcl-lang.io/kpm v0.8.2-0.20240315081549-f70f6ff67ef5
14
14
)
15
15
16
16
require (
Original file line number Diff line number Diff line change @@ -1741,8 +1741,8 @@ kcl-lang.io/kcl-openapi v0.6.0 h1:qg/c0+e2Q2eyejarVvm3FCxRQ4mIPXqEBoheazHqsAg=
1741
1741
kcl-lang.io/kcl-openapi v0.6.0 /go.mod h1:Ai9mFztCVKkRSFabczO/r5hCNdqaNtAc2ZIRxTeV0Mk =
1742
1742
kcl-lang.io/kcl-playground v0.5.1 h1:MKQQUHgt4+2QyU2NVwa73oksOaBJGDi4keGoggA0MiU =
1743
1743
kcl-lang.io/kcl-playground v0.5.1 /go.mod h1:IFmnlw7m011ccX8OidMUfnnN2u/TWdtQGxyABRTbmow =
1744
- kcl-lang.io/kpm v0.8.1 h1:vJNRhlDSfD6bFAPGeRxHKbu3Ml9LesuMbMwGy/rH7/8 =
1745
- kcl-lang.io/kpm v0.8.1 /go.mod h1:3atE1tEbsSPaAuKslkADH1HTDi7SMWlDWllmuk2XsBA =
1744
+ kcl-lang.io/kpm v0.8.2-0.20240315081549-f70f6ff67ef5 h1:YNRiCo/mB3Xh3qhWQrxf1rJ4T2rTx5lDgPDIKbnsRgM =
1745
+ kcl-lang.io/kpm v0.8.2-0.20240315081549-f70f6ff67ef5 /go.mod h1:3atE1tEbsSPaAuKslkADH1HTDi7SMWlDWllmuk2XsBA =
1746
1746
kcl-lang.io/lib v0.8.0 h1:bzMzPpaXaAxWO9JP0B7eI2ZFOYfojdEYUMtNGlUrPx4 =
1747
1747
kcl-lang.io/lib v0.8.0 /go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY =
1748
1748
oras.land/oras-go v1.2.3 h1:v8PJl+gEAntI1pJ/LCrDgsuk+1PKVavVEPsYIHFE5uY =
You can’t perform that action at this time.
0 commit comments