-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
6 deletions.
There are no files selected for viewing
24 changes: 18 additions & 6 deletions
24
...s/git_completer/cmd/difftool_generated.go → completers/git_completer/cmd/difftool.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/rsteube/carapace-bin/pkg/actions/git" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var difftoolCmd = &cobra.Command{ | ||
Use: "difftool", | ||
Short: "Show changes using common diff tools", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
}, | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(difftoolCmd).Standalone() | ||
|
||
difftoolCmd.Flags().BoolP("dir-diff", "d", false, "perform a full-directory diff") | ||
difftoolCmd.Flags().StringP("extcmd", "x", "", "specify a custom command for viewing diffs") | ||
difftoolCmd.Flags().BoolP("gui", "g", false, "use `diff.guitool` instead of `diff.tool`") | ||
difftoolCmd.Flags().Bool("no-index", false, "passed to `diff`") | ||
difftoolCmd.Flags().BoolP("no-prompt", "y", false, "do not prompt before launching a diff tool") | ||
difftoolCmd.Flags().Bool("symlinks", false, "use symlinks in dir-diff mode") | ||
difftoolCmd.Flags().StringP("tool", "t", "", "use the specified diff tool") | ||
difftoolCmd.Flags().Bool("tool-help", false, "print a list of diff tools that may be used with `--tool`") | ||
difftoolCmd.Flags().Bool("trust-exit-code", false, "make 'git-difftool' exit when an invoked diff tool returns a non - zero exit code") | ||
difftoolCmd.Flags().BoolP("tool", "t", false, "<tool> use the specified diff tool") | ||
difftoolCmd.Flags().BoolP("extcmd", "x", false, "<command> specify a custom command for viewing diffs") | ||
difftoolCmd.Flags().BoolP("no-prompt", "y", false, "do not prompt before launching a diff tool") | ||
difftoolCmd.Flags().Bool("trust-exit-code", false, "exit when an invoked diff tool returns a non - zero exit code") | ||
rootCmd.AddCommand(difftoolCmd) | ||
|
||
carapace.Gen(difftoolCmd).FlagCompletion(carapace.ActionMap{ | ||
"tool": carapace.ActionFiles(), | ||
}) | ||
|
||
carapace.Gen(difftoolCmd).PositionalCompletion( | ||
git.ActionRefs(git.RefOptionDefault), | ||
git.ActionRefs(git.RefOptionDefault), | ||
) | ||
} |