Skip to content

Commit 86f0299

Browse files
committed
feat: add branch flag for the kcl mod add command
Signed-off-by: peefy <[email protected]>
1 parent f10084a commit 86f0299

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/kcl/commands/mod.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
git string
3434
tag string
3535
commit string
36+
branch string
3637
target string
3738
rename string
3839
noSumCheck bool

cmd/kcl/commands/mod_add.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ func NewModAddCmd(cli *client.KpmClient) *cobra.Command {
4444
SilenceUsage: true,
4545
}
4646

47-
cmd.Flags().StringVar(&git, "git", "", "git repository location")
47+
cmd.Flags().StringVar(&git, "git", "", "git repository url")
4848
cmd.Flags().StringVar(&tag, "tag", "", "git repository tag")
4949
cmd.Flags().StringVar(&commit, "commit", "", "git repository commit")
50+
cmd.Flags().StringVar(&branch, "branch", "", "git repository branch")
5051
cmd.Flags().StringVar(&rename, "rename", "", "rename the dependency")
5152
cmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "quiet (no output)")
5253
cmd.Flags().BoolVar(&noSumCheck, "no_sum_check", false, "do not check the checksum of the package and update kcl.mod.lock")
@@ -130,6 +131,7 @@ func parseAddOptions(cli *client.KpmClient, localPath string, args []string) (*o
130131
Url: git,
131132
Tag: tag,
132133
Commit: commit,
134+
Branch: branch,
133135
},
134136
},
135137
NoSumCheck: noSumCheck,

0 commit comments

Comments
 (0)