pull file
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
Close Stale Issues / close_stale_issues (push) Has been cancelled
repo-sync / repo-sync (push) Has been cancelled
auto-deploy-tencent-scf / pre-check (push) Has been cancelled
auto-deploy-tencent-scf / deploy serverless (push) Has been cancelled

This commit is contained in:
2026-02-11 23:32:56 +08:00
commit e519cac94e
656 changed files with 45058 additions and 0 deletions

39
krew/pkg/cmd/cmd.go Normal file
View File

@@ -0,0 +1,39 @@
package cmd
import (
"log"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
const (
biliproDesc = `Manage and deploy bilibili pro tools on k8s`
kubeconfig = "kubeconfig"
)
var (
confPath string
rootCmd = &cobra.Command{
Use: "bilipro",
Long: biliproDesc,
SilenceUsage: true,
}
)
func init() {
rootCmd.PersistentFlags().StringVar(&confPath, kubeconfig, "", "Custom kubeconfig path")
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
}
// New creates a new root command for kubectl-bilipro
func NewExecutor(streams genericclioptions.IOStreams) *cobra.Command {
cobra.EnableCommandSorting = false
rootCmd.AddCommand(newInitCmd(rootCmd.OutOrStdout(), rootCmd.ErrOrStderr()))
// If you want to update, just init again
rootCmd.AddCommand(newGetCmd(rootCmd.OutOrStdout(), rootCmd.ErrOrStderr()))
rootCmd.AddCommand(newDeleteCmd(rootCmd.OutOrStdout(), rootCmd.ErrOrStderr()))
rootCmd.AddCommand(newVersionCmd(rootCmd.OutOrStdout(), rootCmd.ErrOrStderr()))
return rootCmd
}