ignore
1package cmd2
3import (4"fmt"5"github.com/charmbracelet/log"6cc "github.com/ivanpirog/coloredcobra"7"github.com/spf13/cobra"8"os"9"strings"10)
11
12var rootCmd = &cobra.Command{13Use: "ignore",14Short: "Create files .ignore quickly and simply",15// Run: func(cmd *cobra.Command, args []string) { },16}
17
18func Execute() {19cc.Init(&cc.Config{20RootCmd: rootCmd,21Headings: cc.HiBlue + cc.Bold + cc.Underline,22Commands: cc.HiYellow + cc.Bold,23Example: cc.Italic,24ExecName: cc.Bold,25Flags: cc.Bold,26FlagsDataType: cc.Italic + cc.HiBlue,27NoExtraNewlines: true,28NoBottomNewline: true,29})30err := rootCmd.Execute()31if err != nil {32os.Exit(1)33}34}
35
36func init() {37rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")38}
39
40func handleErr(err error) {41if err == nil {42return43}44
45log.Error(err)46_, _ = fmt.Fprintf(47os.Stderr,48"%s\n",49strings.Trim(err.Error(), " \n"),50)51os.Exit(1)52}
53