Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package command
import (
"context"
"os"
"os/signal"
"syscall"
"github.com/qsfera/server/qsfera/pkg/register"
"github.com/qsfera/server/pkg/clihelper"
"github.com/qsfera/server/pkg/config"
"github.com/spf13/cobra"
)
// Execute is the entry point for the qsfera command.
func Execute() error {
cfg := config.DefaultConfig()
app := clihelper.DefaultApp(&cobra.Command{
Use: "qsfera",
Short: "qsfera",
})
for _, commandFactory := range register.Commands {
command := commandFactory(cfg)
if command.GroupID != "" && !app.ContainsGroup(command.GroupID) {
app.AddGroup(&cobra.Group{
ID: command.GroupID,
Title: command.GroupID,
})
}
app.AddCommand(command)
}
app.SetArgs(os.Args[1:])
ctx, _ := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP)
return app.ExecuteContext(ctx)
}