mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:46:45 +08:00
cleanup code
This commit is contained in:
1 parent
ad0dc7c89d
commit
51dbc6780b
2 files changed
+2
-10
No files matched your search
@@ -1,9 +1,3 @@
|
|||||||
package main
|
package main
|
||||||
|
import "github.com/daveberrys/guh/src/cmd"
|
||||||
import (
|
func main() { cmd.Execute() }
|
||||||
"github.com/daveberrys/guh/src/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
cmd.Execute()
|
|
||||||
}
|
|
||||||
@@ -12,12 +12,10 @@ var rootCmd = &cobra.Command{
|
|||||||
Short: "Guh is a modular CLI tool",
|
Short: "Guh is a modular CLI tool",
|
||||||
Long: `A comprehensive CLI tool built with Go and Cobra to demonstrate multi-command structures.`,
|
Long: `A comprehensive CLI tool built with Go and Cobra to demonstrate multi-command structures.`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// This runs if no subcommand is provided
|
|
||||||
fmt.Println("Welcome to guh! Use --help to see available commands.")
|
fmt.Println("Welcome to guh! Use --help to see available commands.")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
|||||||
Reference in new issue
Block a user