-
-
Notifications
You must be signed in to change notification settings - Fork 55
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 #1930 from rsteube/git-checkignore
git: check-ignore
- Loading branch information
Showing
2 changed files
with
34 additions
and
24 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,34 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var checkIgnoreCmd = &cobra.Command{ | ||
Use: "check-ignore", | ||
Short: "Debug gitignore / exclude files", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
GroupID: groups[group_low_level_helper].ID, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(checkIgnoreCmd).Standalone() | ||
|
||
checkIgnoreCmd.Flags().Bool("no-index", false, "ignore index when checking") | ||
checkIgnoreCmd.Flags().BoolP("non-matching", "n", false, "show non-matching input paths") | ||
checkIgnoreCmd.Flags().BoolP("quiet", "q", false, "suppress progress reporting") | ||
checkIgnoreCmd.Flags().Bool("stdin", false, "read file names from stdin") | ||
checkIgnoreCmd.Flags().BoolP("verbose", "v", false, "be verbose") | ||
checkIgnoreCmd.Flags().BoolS("z", "z", false, "terminate input and output records by a NUL character") | ||
rootCmd.AddCommand(checkIgnoreCmd) | ||
|
||
carapace.Gen(checkIgnoreCmd).PositionalAnyCompletion( | ||
carapace.ActionCallback(func(c carapace.Context) carapace.Action { | ||
if checkIgnoreCmd.Flag("stdin").Changed { | ||
return carapace.ActionValues() | ||
} | ||
return carapace.ActionFiles() | ||
}), | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.