Skip to content

Commit

Permalink
Merge pull request #1930 from rsteube/git-checkignore
Browse files Browse the repository at this point in the history
git: check-ignore
  • Loading branch information
rsteube authored Oct 29, 2023
2 parents 01f4ff8 + ee86c8d commit 313fa85
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
34 changes: 34 additions & 0 deletions completers/git_completer/cmd/checkIgnore.go
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()
}),
)
}
24 changes: 0 additions & 24 deletions completers/git_completer/cmd/check_ignore_generated.go

This file was deleted.

0 comments on commit 313fa85

Please sign in to comment.