github.com/erikjuhani/git-gong@v0.0.0-20220213141213-6b9fa82d4e7c/cmd/git.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/erikjuhani/git-gong/gong"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  func init() {
     9  	rootCmd.AddCommand(gitCmd)
    10  }
    11  
    12  var gitCmd = &cobra.Command{
    13  	Use:   "git [args]",
    14  	Short: "Run Git commands by providing any Git compatible arguments",
    15  	Long: `Run Git commands by providing any Git compatible arguments
    16  
    17    Needs Git installed in the system.
    18  	`,
    19  	DisableFlagParsing: true,
    20  	Run: func(cmd *cobra.Command, args []string) {
    21  		if err := gong.RunGitCommand(args); err != nil {
    22  			cmd.PrintErr(err)
    23  		}
    24  	},
    25  }