Skip to content

Commit

Permalink
Merge pull request #2513 from carapace-sh/git-for-each-repo
Browse files Browse the repository at this point in the history
git: for-each-repo
  • Loading branch information
rsteube authored Aug 17, 2024
2 parents c07d3ca + 4e08c40 commit 4ec7fd9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
File renamed without changes.
33 changes: 33 additions & 0 deletions completers/git_completer/cmd/forEachRepo.go
Original file line number Diff line number Diff line change
@@ -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),
)
}

0 comments on commit 4ec7fd9

Please sign in to comment.