File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99 "github.com/major-technology/cli/clients/config"
1010 mjrToken "github.com/major-technology/cli/clients/token"
1111 "github.com/major-technology/cli/cmd/app"
12- "github.com/major-technology/cli/cmd/git"
1312 "github.com/major-technology/cli/cmd/org"
1413 "github.com/major-technology/cli/cmd/resource"
1514 "github.com/major-technology/cli/cmd/user"
@@ -90,11 +89,20 @@ func init() {
9089 })
9190
9291 // Register subcommands
92+ rootCmd .AddGroup (& cobra.Group {ID : "main" , Title : "Main Commands" })
93+ rootCmd .AddGroup (& cobra.Group {ID : "config" , Title : "Configurations" })
94+
95+ user .Cmd .GroupID = "config"
9396 rootCmd .AddCommand (user .Cmd )
97+
98+ org .Cmd .GroupID = "config"
9499 rootCmd .AddCommand (org .Cmd )
100+
101+ app .Cmd .GroupID = "main"
95102 rootCmd .AddCommand (app .Cmd )
103+
104+ resource .Cmd .GroupID = "main"
96105 rootCmd .AddCommand (resource .Cmd )
97- rootCmd .AddCommand (git .GitCmd )
98106}
99107
100108func initConfig () {
Original file line number Diff line number Diff line change 1- package git
1+ package user
22
33import (
44 "github.com/charmbracelet/huh"
@@ -8,17 +8,17 @@ import (
88 "github.com/spf13/cobra"
99)
1010
11- // configCmd represents the git config command
12- var configCmd = & cobra.Command {
13- Use : "config " ,
11+ // gitconfigCmd represents the gitconfig command
12+ var gitconfigCmd = & cobra.Command {
13+ Use : "gitconfig " ,
1414 Short : "Configure git settings" ,
1515 Long : `Configure git-related settings such as your GitHub username.` ,
1616 RunE : func (cobraCmd * cobra.Command , args []string ) error {
17- return runConfig (cobraCmd )
17+ return runGitConfig (cobraCmd )
1818 },
1919}
2020
21- func runConfig (cobraCmd * cobra.Command ) error {
21+ func runGitConfig (cobraCmd * cobra.Command ) error {
2222 // Get current GitHub username if it exists
2323 currentUsername , err := mjrToken .GetGithubUsername ()
2424 if err != nil {
Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ func init() {
2424 Cmd .AddCommand (loginCmd )
2525 Cmd .AddCommand (logoutCmd )
2626 Cmd .AddCommand (whoamiCmd )
27+ Cmd .AddCommand (gitconfigCmd )
2728}
You can’t perform that action at this time.
0 commit comments