-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2506 from carapace-sh/git-diff-index
git: diff-index
- Loading branch information
Showing
3 changed files
with
37 additions
and
38 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"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/spf13/cobra" | ||
) | ||
|
||
var diffIndexCmd = &cobra.Command{ | ||
Use: "diff-index", | ||
Short: "Compare a tree to the working tree or index", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
GroupID: groups[group_low_level_interrogator].ID, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(diffIndexCmd).Standalone() | ||
|
||
diffIndexCmd.Flags().StringS("G", "G", "", "look for differences whose patch text contains added/removed lines that match <regex>") | ||
diffIndexCmd.Flags().Bool("default-prefix", false, "use the default source and destination prefixes") | ||
diffIndexCmd.Flags().StringP("ignore-matching-lines", "I", "", "ignore changes whose all lines match <regex>") | ||
diffIndexCmd.Flags().BoolS("m", "m", false, "make git diff-index say that all non-checked-out files are up to date") | ||
diffIndexCmd.Flags().Bool("merge-base", false, "use the merge base between <tree-ish> and HEAD") | ||
diffIndexCmd.Flags().Bool("no-relative", false, "do not make the output relative") | ||
diffIndexCmd.Flags().Bool("no-textconv", false, "do not external text conversion filters to be run") | ||
diffIndexCmd.Flags().Bool("quiet", false, "disable all output of the program") | ||
diffIndexCmd.Flags().String("rotate-to", "", "move files before the named <file> to the end") | ||
diffIndexCmd.Flags().String("skip-to", "", "discard the files before the named <file> from the output ") | ||
common.AddDiffFlags(diffIndexCmd) | ||
rootCmd.AddCommand(diffIndexCmd) | ||
|
||
carapace.Gen(diffIndexCmd).PositionalCompletion( | ||
git.ActionRefs(git.RefOption{}.Default()), | ||
carapace.ActionFiles(), | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.