feat: add configuration flags and enhance config initialization

This commit is contained in:
krau
2025-12-19 13:49:13 +08:00
parent d3cc56c8e6
commit df64ec3069
4 changed files with 119 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/krau/SaveAny-Bot/config"
"github.com/spf13/cobra"
)
@@ -13,6 +14,10 @@ var rootCmd = &cobra.Command{
Run: Run,
}
func init() {
config.RegisterFlags(rootCmd)
}
func Execute(ctx context.Context) {
if err := rootCmd.ExecuteContext(ctx); err != nil {
fmt.Println(err)