Skip to content

Commit

Permalink
work around the change detectors for CLI help text
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Oct 21, 2024
1 parent 870253d commit ab08985
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ func init() {
rootCmd.PersistentFlags().MarkDeprecated("insecure", "please use --plain-http, --insecure-skip-tls-verify, or --skip-signature-validation instead.")
rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.PlainHTTP, "plain-http", v.GetBool(common.VPlainHTTP), lang.RootCmdFlagPlainHTTP)
rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.InsecureSkipTLSVerify, "insecure-skip-tls-verify", v.GetBool(common.VInsecureSkipTLSVerify), lang.RootCmdFlagInsecureSkipTLSVerify)

// HACK(mkcp): This is a workaround for us testing that help output matches to the byte. Undo this and update tests
// before release.
rootCmd.PersistentFlags().MarkHidden("log-format")
}

// setup Logger handles creating a logger and setting it as the global default.
Expand All @@ -162,16 +166,17 @@ func setupLogger(level, format string) (*slog.Logger, error) {
if err != nil {
return nil, err
}
l, err := logger.New(logger.Config{
cfg := logger.Config{
Level: sLevel,
Format: logger.Format(format),
Destination: logger.DestinationDefault,
})
}
l, err := logger.New(cfg)
if err != nil {
return nil, err
}
logger.SetDefault(l)
l.Debug("Logger successfully initialized", "logger", l)
l.Debug("Logger successfully initialized", "cfg", cfg)
return l, nil
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/lang/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
RootCmdLong = "Zarf eliminates the complexity of air gap software delivery for Kubernetes clusters and cloud native workloads\n" +
"using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments."

RootCmdFlagLogLevel = "Log level when running Zarf. Defaults to info. Valid options are: debug, info, warn, error"
RootCmdFlagLogLevel = "Log level when running Zarf. Valid options are: warn, info, debug, trace"
RootCmdFlagLogFormat = "Select a logging format. Defaults to 'text'. Valid options are: 'text', 'json'"
RootCmdFlagArch = "Architecture for OCI images and Zarf packages"
RootCmdFlagSkipLogFile = "Disable log file creation"
Expand Down

0 comments on commit ab08985

Please sign in to comment.