mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:46:45 +08:00
code cleanup, implement init repo
This commit is contained in:
1 parent
aa4f72b87d
commit
2b75245d3c
5 files changed
+21
-12
No files matched your search
+1
-3
@@ -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",
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user