-
-
Notifications
You must be signed in to change notification settings - Fork 53
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 #2513 from carapace-sh/git-for-each-repo
git: for-each-repo
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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,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), | ||
) | ||
} |