Skip to content

Commit 4f051c9

Browse files
authored
Merge pull request #19 from gomicro/more-flags
add flags for pushing
2 parents b1d0de4 + b37fe30 commit 4f051c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/push.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ import (
1212
)
1313

1414
var (
15+
all bool
16+
force bool
1517
setUpstream bool
1618
)
1719

1820
func init() {
1921
RootCmd.AddCommand(pushCmd)
2022

2123
pushCmd.Flags().StringVarP(&dir, "dir", "d", ".", "directory to push repos from")
24+
pushCmd.Flags().BoolVar(&all, "all", false, "all branches")
25+
pushCmd.Flags().BoolVar(&force, "force", false, "force push")
2226
pushCmd.Flags().BoolVarP(&setUpstream, "set-upstream", "u", false, "set upstream tracking reference")
2327
}
2428

@@ -49,6 +53,14 @@ func pushFunc(cmd *cobra.Command, args []string) error {
4953
args = slices.Insert(args, 0, "--set-upstream")
5054
}
5155

56+
if all {
57+
args = slices.Insert(args, 0, "--all")
58+
}
59+
60+
if force {
61+
args = slices.Insert(args, 0, "--force")
62+
}
63+
5264
err = clt.PushRepos(ctx, repoDirs, args...)
5365
if err != nil {
5466
cmd.SilenceUsage = true

0 commit comments

Comments
 (0)