INNER CODE UNIT · Go

printOptions

ktr0731/evans · app/commands.go:298

func printOptions(w io.Writer, cmd *cobra.Command, inheritedFlags []string) {
	_, err := io.WriteString(w, "Options:\n")
	if err != nil {
		logger.Printf("failed to write string: %s", err)
	}
	tw := tabwriter.NewWriter(w, 0, 8, 8, ' ', tabwriter.TabIndent)
	var hasHelp bool
	f := cmd.LocalFlags()
	isRootCommand := cmd.Parent() == nil
	printFlag := func(f *pflag.Flag) {
		if isRootCommand && f.Hidden {
			return
		}
		if f.Name == "help" {
			hasHelp = true
		}
		cmd := "--" + f.Name
		if f.Shorthand != "" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…