From 15d7b24aec48642baa70b415b666e3a31fd9b730 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Sun, 1 Sep 2013 20:52:23 +0400 Subject: [PATCH] Remove verbose flag. --- nut/lock.go | 10 +--------- nut/vcs.go | 8 ++++---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/nut/lock.go b/nut/lock.go index 5ed19ec..b5d39a2 100644 --- a/nut/lock.go +++ b/nut/lock.go @@ -16,8 +16,6 @@ var ( UsageLine: "lock [-v]", Short: "lock", } - - lockV bool ) func init() { @@ -27,15 +25,9 @@ Generates or updates dependencies.json in current directory. Examples: nut lock ` - - cmdLock.Flag.BoolVar(&lockV, "v", false, vHelp) } func runLock(cmd *command) { - if !lockV { - lockV = Config.V - } - // collect import paths var importPaths []string err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error { @@ -88,7 +80,7 @@ func runLock(cmd *command) { continue } imported[root] = true - rev := vcsCurrent(vcs, root, lockV) + rev := vcsCurrent(vcs, root) if rev == "" { continue } diff --git a/nut/vcs.go b/nut/vcs.go index cbedd5b..d772a1d 100644 --- a/nut/vcs.go +++ b/nut/vcs.go @@ -32,7 +32,7 @@ func vcsRoot(dir string) (vcs, root string) { return } -func vcsCheckout(vcs, rev, dir string, verbose bool) { +func vcsCheckout(vcs, rev, dir string) { var args string switch vcs { case "bzr": @@ -47,7 +47,7 @@ func vcsCheckout(vcs, rev, dir string, verbose bool) { c := exec.Command(vcs, strings.Split(args, " ")...) c.Dir = dir - if verbose { + if Config.Debug { log.Printf("Running %q (in %q)", strings.Join(c.Args, " "), dir) } out, err := c.CombinedOutput() @@ -57,7 +57,7 @@ func vcsCheckout(vcs, rev, dir string, verbose bool) { fatalIfErr(err) } -func vcsCurrent(vcs, root string, verbose bool) (rev string) { +func vcsCurrent(vcs, root string) (rev string) { args := map[string]string{ "bzr": "testament", "git": "rev-parse --verify HEAD", @@ -66,7 +66,7 @@ func vcsCurrent(vcs, root string, verbose bool) (rev string) { c := exec.Command(vcs, strings.Split(args, " ")...) c.Dir = root - if verbose { + if Config.Debug { log.Printf("Running %q (in %q)", strings.Join(c.Args, " "), c.Dir) } out, err := c.CombinedOutput()