file cleanup, skill issue typing

This commit is contained in:
daveberrys committed 2026-07-15 22:03:13 +08:00
1 parent b0836cdca8
commit bb6ffb1271
2 files changed
+1 -34

No files matched your search

-33
View File
@@ -1,33 +0,0 @@
package cmd
import (
"fmt"
"github.com/daveberrys/guh/src/utils"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(renameCmd)
renameCmd.AddCommand(renameBranchCmd)
}
var renameCmd = &cobra.Command{
Use: "rename",
Short: "Rename branches",
}
var renameBranchCmd = &cobra.Command{
Use: "branch [name]",
Short: "Rename a specific branch",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return renameBranch(args[0])
},
}
func renameBranch(branchName string) error {
utils.RunGitSequence(false, []string{"branch", "-m", branchName})
fmt.Println("Successfully renamed branch to", branchName)
return nil
}
+1 -1
View File
@@ -12,7 +12,7 @@ var switchBranchCmd = &cobra.Command{
Short: "Switch to a specific branch", Short: "Switch to a specific branch",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error { RunE: func(c *cobra.Command, args []string) error {
utils.RunGitequence(false, []string{"switch", args[0]}) utils.RunGitSequence(false, []string{"switch", args[0]})
fmt.Printf("Switched to branch: %s\n", args[0]) fmt.Printf("Switched to branch: %s\n", args[0])
return nil return nil
}, },