This is only compiled in when a `dev` build tag is specified (see #75) for safety. Attempting to use the flag without that tag at build time will fail. However, it is always available within the codebase itself so that tests can be written against this functionality in a programmatic way. Manual testing was performed; no plans to add automated ones as this isn't production-necessary nor exported functionality.
19 lines
464 B
Go
19 lines
464 B
Go
// +build dev
|
|
|
|
package dev
|
|
|
|
import "github.com/hashicorp/watchtower/internal/cmd/base"
|
|
|
|
func init() {
|
|
devOnlyControllerFlags = addDevOnlyControllerFlags
|
|
}
|
|
|
|
func addDevOnlyControllerFlags(c *Command, f *base.FlagSet) {
|
|
f.StringVar(&base.StringVar{
|
|
Name: "dev-passthrough-directory",
|
|
Target: &c.flagDevPassthroughDirectory,
|
|
EnvVar: "WATCHTOWER_DEV_PASSTHROUGH_DIRECTORY",
|
|
Usage: "Enables a passthrough directory in the webserver at /passthrough",
|
|
})
|
|
}
|