From 4a76ed12e7cfd0710ba5a509c39851fb02b5d75f Mon Sep 17 00:00:00 2001 From: Igor Postelnik Date: Fri, 15 Jan 2021 14:25:20 -0600 Subject: [PATCH] TUN-3766: Print flags defined at all levels of command hierarchy, not just locally defined flags for a command. This fixes output of overriden settings for subcommand. --- cmd/cloudflared/tunnel/configuration.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cmd/cloudflared/tunnel/configuration.go b/cmd/cloudflared/tunnel/configuration.go index 8363814b..22ac21ff 100644 --- a/cmd/cloudflared/tunnel/configuration.go +++ b/cmd/cloudflared/tunnel/configuration.go @@ -61,19 +61,12 @@ func generateRandomClientID(log *zerolog.Logger) (string, error) { func logClientOptions(c *cli.Context, log *zerolog.Logger) { flags := make(map[string]interface{}) - for _, flag := range c.LocalFlagNames() { + for _, flag := range c.FlagNames() { flags[flag] = c.Generic(flag) } - sliceFlags := []string{"header", "tag", "proxy-dns-upstream", "upstream", "edge"} - for _, sliceFlag := range sliceFlags { - if len(c.StringSlice(sliceFlag)) > 0 { - flags[sliceFlag] = strings.Join(c.StringSlice(sliceFlag), ", ") - } - } - if len(flags) > 0 { - log.Info().Msgf("Environment variables %v", flags) + log.Info().Msgf("Settings: %v", flags) } envs := make(map[string]string)