code cleanup, implement init repo

This commit is contained in:
daveberrys committed 2026-07-15 22:25:54 +08:00
1 parent aa4f72b87d
commit 2b75245d3c
5 files changed
+21 -12

No files matched your search

+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func init() { func init() { rootCmd.AddCommand(diffCmd) }
rootCmd.AddCommand(diffCmd)
}
var diffCmd = &cobra.Command{ var diffCmd = &cobra.Command{
Use: "diff", Use: "diff",
+17
View File
@@ -0,0 +1,17 @@
package cmd
import (
"github.com/daveberrys/guh/src/utils"
"github.com/spf13/cobra"
)
func init() { rootCmd.AddCommand(initCmd) }
var initCmd = &cobra.Command{
Use: "init",
Short: "Initialize a new repository",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return utils.RunGitSequence(false, []string{"init"})
},
}
+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func init() { func init() { rootCmd.AddCommand(pullCmd) }
rootCmd.AddCommand(pullCmd)
}
var pullCmd = &cobra.Command{ var pullCmd = &cobra.Command{
Use: "pull", Use: "pull",
+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func init() { func init() { rootCmd.AddCommand(pushCmd) }
rootCmd.AddCommand(pushCmd)
}
var pushCmd = &cobra.Command{ var pushCmd = &cobra.Command{
Use: "push", Use: "push",
+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func init() { func init() { rootCmd.AddCommand(stashCmd) }
rootCmd.AddCommand(stashCmd)
}
var stashCmd = &cobra.Command{ var stashCmd = &cobra.Command{
Use: "stash", Use: "stash",