Skip to content

Commit

Permalink
Merge pull request #2325 from carapace-sh/git-show-flags
Browse files Browse the repository at this point in the history
git: show - added missing flags (incomplete)
  • Loading branch information
rsteube authored Oct 22, 2024
2 parents 8b8efe3 + 5671b7b commit d400042
Show file tree
Hide file tree
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
Expand Up @@ -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"
Expand Down
9 changes: 8 additions & 1 deletion completers/git_completer/cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit d400042

Please sign in to comment.