Skip to content

Commit

Permalink
git: show - added missing flags (incomplete)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 21, 2024
1 parent 8b8efe3 commit 5671b7b
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions completers/git_completer/cmd/common/diff.go
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ func AddDiffFlags(cmd *cobra.Command) {
cmd.Flags().String("ws-error-highlight", "", "Highlight whitespace errors in the context, old or new lines of the diff")
cmd.Flags().BoolS("z", "z", false, "do not munge pathnames and use NULs as output field terminators")

cmd.Flag("color").NoOptDefVal = " "
cmd.Flag("color-moved").NoOptDefVal = "default"
cmd.Flag("color-moved-ws").NoOptDefVal = " "
cmd.Flag("word-diff").NoOptDefVal = "plain"
9 changes: 8 additions & 1 deletion completers/git_completer/cmd/show.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import (
"strings"

"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/git_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
"github.com/carapace-sh/carapace/pkg/traverse"
"github.com/spf13/cobra"
@@ -24,9 +25,15 @@ func init() {
showCmd.Flags().String("decorate-refs", "", "only decorate refs that match <pattern>")
showCmd.Flags().String("decorate-refs-exclude", "", "do not decorate refs that match <pattern>")
showCmd.Flags().Bool("mailmap", false, "alias of --use-mailmap")
showCmd.Flags().BoolP("quiet", "q", false, "suppress diff output")
showCmd.Flags().Bool("source", false, "show source")
showCmd.Flags().Bool("use-mailmap", false, "Use mail map file")
common.AddBisectionHelperOptions(showCmd)
common.AddCommitFormattingOptions(showCmd)
common.AddCommitLimitingOptions(showCmd)
common.AddCommitOrderingOptions(showCmd)
common.AddDiffFlags(showCmd)
common.AddHistorySimplificationOptions(showCmd)
common.AddObjectTraversalOptions(showCmd)
rootCmd.AddCommand(showCmd)

showCmd.Flag("decorate").NoOptDefVal = "short"

0 comments on commit 5671b7b

Please sign in to comment.