diff --git a/completers/git_completer/cmd/for_each_ref.go b/completers/git_completer/cmd/forEachRef.go similarity index 100% rename from completers/git_completer/cmd/for_each_ref.go rename to completers/git_completer/cmd/forEachRef.go diff --git a/completers/git_completer/cmd/forEachRepo.go b/completers/git_completer/cmd/forEachRepo.go new file mode 100644 index 0000000000..816b7c951b --- /dev/null +++ b/completers/git_completer/cmd/forEachRepo.go @@ -0,0 +1,33 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bridge/pkg/actions/bridge" + "github.com/spf13/cobra" +) + +var forEachRepoCmd = &cobra.Command{ + Use: "for-each-repo", + Short: "Run a Git command on a list of repositories", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_low_level_interrogator].ID, +} + +func init() { + carapace.Gen(forEachRepoCmd).Standalone() + forEachRepoCmd.Flags().SetInterspersed(false) + + forEachRepoCmd.Flags().String("config", "", "use the given config variable as a multi-valued list storing absolute path names.") + forEachRepoCmd.Flags().Bool("keep-going", false, "continue with the remaining repositories if the command failed on a repository") + rootCmd.AddCommand(forEachRepoCmd) + + // TODO complete config + + carapace.Gen(forEachRepoCmd).PositionalAnyCompletion( + bridge.ActionCarapaceBin("git"), + ) + + carapace.Gen(forEachRefCmd).DashAnyCompletion( + carapace.ActionPositional(forEachRepoCmd), + ) +}