diff --git a/cmd/diff.go b/cmd/diff.go index 1e24cc4..f07b398 100644 --- a/cmd/diff.go +++ b/cmd/diff.go @@ -30,7 +30,6 @@ func init() { diffCmd.Flags().BoolVar(&check, "check", false, "exit non-zero if whitespace errors are found (equivalent to git diff --check)") diffCmd.Flags().BoolVar(&ignoreEmpty, "ignore-empty", false, "ignore empty diffs") - diffCmd.Flags().BoolVar(&noColor, "no-color", false, "disable color output") diffCmd.Flags().BoolVar(&short, "shortstat", false, "show only the number of changed files, insertions, and deletions") diffCmd.Flags().BoolVar(&nameOnly, "name-only", false, "show only names of changed files") @@ -77,6 +76,7 @@ func diffCmdValidArgsFunc(cmd *cobra.Command, args []string, toComplete string) func diffFunc(cmd *cobra.Command, args []string) error { verbose := viper.GetBool("verbose") + noColor := viper.GetBool("no-color") ctx := ctxhelper.WithVerbose(context.Background(), verbose) repoDirs, err := clt.GetDirs(ctx, ".") diff --git a/cmd/log.go b/cmd/log.go index b2c1e41..050cf93 100644 --- a/cmd/log.go +++ b/cmd/log.go @@ -12,7 +12,6 @@ import ( var ( oneline bool - noColor bool maxCount int ) @@ -20,7 +19,6 @@ func init() { RootCmd.AddCommand(logCmd) logCmd.Flags().BoolVar(&oneline, "oneline", false, "show each commit on a single line") - logCmd.Flags().BoolVar(&noColor, "no-color", false, "disable color output") logCmd.Flags().BoolVar(&ignoreEmpty, "ignore-empty", false, "ignore empty repositories") logCmd.Flags().IntVarP(&maxCount, "max-count", "n", 0, "limit the number of commits shown per repo (0 means no limit)") } @@ -77,6 +75,7 @@ func logCmdValidArgsFunc(cmd *cobra.Command, args []string, toComplete string) ( func logFunc(cmd *cobra.Command, args []string) error { verbose := viper.GetBool("verbose") + noColor := viper.GetBool("no-color") ctx := ctxhelper.WithVerbose(context.Background(), verbose) repoDirs, err := clt.GetDirs(ctx, ".")