diff --git a/Changelog.md b/Changelog.md index 6569c9a..4b95010 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# v30 2015/11/25 + +* Add `-t` flag to the `godep get` command. + # v29 2015/11/17 * Temp work around to fix issue with LICENSE files. diff --git a/get.go b/get.go index 1811bf4..bcc15a4 100644 --- a/get.go +++ b/get.go @@ -7,7 +7,7 @@ import ( ) var cmdGet = &Command{ - Usage: "get [-v] [packages]", + Usage: "get [-v] [-t] [packages]", Short: "download and install packages with specified dependencies", Long: ` Get downloads to GOPATH the packages named by the import paths, and installs @@ -18,13 +18,18 @@ as if by go get. If -verbose is given, verbose output is enabled. +If -t is given, dependencies of test files are also downloaded and installed. + For more about specifying packages, see 'go help packages'. `, Run: runGet, } +var getT bool + func init() { cmdGet.Flag.BoolVar(&verbose, "v", false, "enable verbose output") + cmdGet.Flag.BoolVar(&getT, "t", false, "get test dependencies") } func runGet(cmd *Command, args []string) { @@ -37,6 +42,10 @@ func runGet(cmd *Command, args []string) { cmdArgs = append(cmdArgs, "-v") } + if getT { + cmdArgs = append(cmdArgs, "-t") + } + err := command("go", append(cmdArgs, args)...).Run() if err != nil { log.Fatalln(err) diff --git a/version.go b/version.go index b714977..72af285 100644 --- a/version.go +++ b/version.go @@ -5,7 +5,7 @@ import ( "runtime" ) -const version = 29 +const version = 30 var cmdVersion = &Command{ Usage: "version",