INNER CODE UNIT · Go
NormalizeFormat
Netis/cloud-probe · cpctl/cmd/base.go:97
func NormalizeFormat(format *string) error {
switch strings.ToLower(*format) {
case FormatText:
*format = FormatText
case FormatJSONL, "ndjson":
*format = FormatJSONL
default:
return fmt.Errorf("invalid --format %q (text|jsonl, ndjson accepted as alias)", *format)
}
return nil
}
func RootCmd() *cobra.Command {
return rootCmd
}
func init() {
pf := rootCmd.PersistentFlags()