Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 7c4a5d6

Browse files
authored
Merge pull request #1506 from ibrasho-forks/add-no-op-prune
Add no-op prune command
2 parents 9815e4a + d2e36ef commit 7c4a5d6

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

cmd/dep/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (c *Config) Run() int {
6767
&initCommand{},
6868
&statusCommand{},
6969
&ensureCommand{},
70+
&pruneCommand{},
7071
&hashinCommand{},
7172
&versionCommand{},
7273
}

cmd/dep/prune.go

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2017 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"flag"
9+
10+
"github.com/golang/dep"
11+
)
12+
13+
const pruneShortHelp = `Prune was merged into ensure. Use ensure instead.`
14+
const pruneLongHelp = `
15+
Prune was merged into the ensure command.
16+
Set prune options in the manifest and it will be applied after every ensure.
17+
`
18+
19+
type pruneCommand struct{}
20+
21+
func (cmd *pruneCommand) Name() string { return "prune" }
22+
func (cmd *pruneCommand) Args() string { return "" }
23+
func (cmd *pruneCommand) ShortHelp() string { return pruneShortHelp }
24+
func (cmd *pruneCommand) LongHelp() string { return pruneLongHelp }
25+
func (cmd *pruneCommand) Hidden() bool { return true }
26+
27+
func (cmd *pruneCommand) Register(fs *flag.FlagSet) {}
28+
29+
func (cmd *pruneCommand) Run(ctx *dep.Ctx, args []string) error {
30+
ctx.Out.Printf("Prune was merged into ensure.\n")
31+
ctx.Out.Printf("Set prune settings in %s and it it will be applied when running ensure.\n", dep.ManifestName)
32+
33+
return nil
34+
}

0 commit comments

Comments
 (0)