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"
)
func init() {
rootCmd.AddCommand(diffCmd)
}
func init() { rootCmd.AddCommand(diffCmd) }
var diffCmd = &cobra.Command{
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"
)
func init() {
rootCmd.AddCommand(pullCmd)
}
func init() { rootCmd.AddCommand(pullCmd) }
var pullCmd = &cobra.Command{
Use: "pull",
+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(pushCmd)
}
func init() { rootCmd.AddCommand(pushCmd) }
var pushCmd = &cobra.Command{
Use: "push",
+1 -3
View File
@@ -5,9 +5,7 @@ import (
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(stashCmd)
}
func init() { rootCmd.AddCommand(stashCmd) }
var stashCmd = &cobra.Command{
Use: "stash",