25 lines
252 B
Go
25 lines
252 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
root *cobra.Command
|
|
)
|
|
|
|
func Init() {
|
|
root = rootCmd(
|
|
svcCmd(),
|
|
)
|
|
}
|
|
|
|
func Execute(ctx context.Context) {
|
|
if err := root.ExecuteContext(ctx); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|