summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-07-18 10:58:31 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-07-18 10:58:31 -0600
commit0d3f99e85a089a6a772ae38f426b5cd5f2f4583f (patch)
tree4b1c40d1fa3821a1b022e601eddbf86cc6f760af
parent28df6cedfe8d347bd87931960c01e6606c14851e (diff)
cmd: Add print-env flag to run command
-rw-r--r--cmd/commands.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/commands.go b/cmd/commands.go
index 00760f4..072c1d4 100644
--- a/cmd/commands.go
+++ b/cmd/commands.go
@@ -137,9 +137,18 @@ func cmdStart() (int, error) {
func cmdRun() (int, error) {
runCmd := flag.NewFlagSet("run", flag.ExitOnError)
runCmdConfigFlag := runCmd.String("config", "", "Configuration file")
+ runCmdPrintEnvFlag := runCmd.Bool("print-env", false, "Print environment (useful for debugging)")
runCmdPingbackFlag := runCmd.String("pingback", "", "Echo confirmation bytes to this address on success")
runCmd.Parse(os.Args[2:])
+ // if we are supposed to print the environment, do that first
+ if *runCmdPrintEnvFlag {
+ exitCode, err := cmdEnviron()
+ if err != nil {
+ return exitCode, err
+ }
+ }
+
// if a config file was specified for bootstrapping
// the server instance, load it now
var config []byte