1 Star 0 Fork 0

api-go/govendor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sync.go 939 Bytes
一键复制 编辑 原始数据 按行查看 历史
Stephen Shirley 提交于 2016-11-08 16:27 +08:00 . Add verbose flag to govendor sync
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package run
import (
"flag"
"io"
"github.com/kardianos/govendor/context"
"github.com/kardianos/govendor/help"
)
func (r *runner) Sync(w io.Writer, subCmdArgs []string) (help.HelpMessage, error) {
flags := flag.NewFlagSet("sync", flag.ContinueOnError)
insecure := flags.Bool("insecure", false, "allow insecure network updates")
dryrun := flags.Bool("n", false, "dry run, print what would be done")
verbose := flags.Bool("v", false, "verbose output")
flags.SetOutput(nullWriter{})
err := flags.Parse(subCmdArgs)
if err != nil {
return help.MsgSync, err
}
ctx, err := r.NewContextWD(context.RootVendor)
if err != nil {
return help.MsgSync, err
}
ctx.Insecure = *insecure
if *dryrun || *verbose {
ctx.Logger = w
}
return help.MsgNone, ctx.Sync(*dryrun)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/netscript/govendor.git
git@gitee.com:netscript/govendor.git
netscript
govendor
govendor
v1.0.9

搜索帮助