diff --git a/src/cmd/diff.go b/src/cmd/diff.go index 367f960..c9ebb92 100644 --- a/src/cmd/diff.go +++ b/src/cmd/diff.go @@ -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", diff --git a/src/cmd/init.go b/src/cmd/init.go new file mode 100644 index 0000000..fba9b3e --- /dev/null +++ b/src/cmd/init.go @@ -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"}) + }, +} diff --git a/src/cmd/pull.go b/src/cmd/pull.go index 696d171..aeb9dce 100644 --- a/src/cmd/pull.go +++ b/src/cmd/pull.go @@ -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", diff --git a/src/cmd/push.go b/src/cmd/push.go index b356976..2342f38 100644 --- a/src/cmd/push.go +++ b/src/cmd/push.go @@ -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", diff --git a/src/cmd/stash.go b/src/cmd/stash.go index 9b71826..e319107 100644 --- a/src/cmd/stash.go +++ b/src/cmd/stash.go @@ -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",