Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Remove verbose flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Sep 1, 2013
1 parent 563f630 commit 15d7b24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 1 addition & 9 deletions nut/lock.go
Expand Up @@ -16,8 +16,6 @@ var (
UsageLine: "lock [-v]",
Short: "lock",
}

lockV bool
)

func init() {
Expand All @@ -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 {
Expand Down Expand Up @@ -88,7 +80,7 @@ func runLock(cmd *command) {
continue
}
imported[root] = true
rev := vcsCurrent(vcs, root, lockV)
rev := vcsCurrent(vcs, root)
if rev == "" {
continue
}
Expand Down
8 changes: 4 additions & 4 deletions nut/vcs.go
Expand Up @@ -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":
Expand All @@ -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()
Expand All @@ -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",
Expand All @@ -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()
Expand Down

0 comments on commit 15d7b24

Please sign in to comment.