mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-14 11:44:32 +00:00
33 lines
872 B
Go
33 lines
872 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/rsteube/carapace"
|
|
"github.com/rsteube/carapace-bin/pkg/actions/tools/git"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var remote_setUrlCmd = &cobra.Command{
|
|
Use: "set-url",
|
|
Short: "Changes URLs for the remote",
|
|
Run: func(cmd *cobra.Command, args []string) {},
|
|
}
|
|
|
|
func init() {
|
|
carapace.Gen(remote_setUrlCmd).Standalone()
|
|
|
|
remote_setUrlCmd.Flags().Bool("add", false, "add URL")
|
|
remote_setUrlCmd.Flags().Bool("delete", false, "delete URLs")
|
|
remote_setUrlCmd.Flags().Bool("push", false, "manipulate push URLs")
|
|
remoteCmd.AddCommand(remote_setUrlCmd)
|
|
|
|
carapace.Gen(remote_setUrlCmd).PositionalCompletion(
|
|
git.ActionRemotes(),
|
|
carapace.ActionCallback(func(c carapace.Context) carapace.Action {
|
|
return carapace.Batch(
|
|
git.ActionRemoteUrls(c.Args[0]),
|
|
git.ActionRepositorySearch(git.SearchOpts{}.Default()),
|
|
).ToA()
|
|
}),
|
|
)
|
|
}
|