mirror of
https://github.com/hanzoai/numscript.git
synced 2026-10-30 18:26:57 +00:00
* feat: feature flag syntax * feat: change syntax * feat: reject invalid features * feat: add static check of unknown features * feat: more defensive args handling * fix: fix typo
38 lines
632 B
Go
38 lines
632 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
type CliOptions struct {
|
|
Version string
|
|
}
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "numscript",
|
|
Short: "Numscript cli",
|
|
Long: "Numscript cli",
|
|
CompletionOptions: cobra.CompletionOptions{
|
|
DisableDefaultCmd: true,
|
|
},
|
|
}
|
|
|
|
func Execute(options CliOptions) {
|
|
rootCmd.Version = options.Version
|
|
|
|
rootCmd.AddCommand(lspCmd)
|
|
rootCmd.AddCommand(mcpCmd)
|
|
rootCmd.AddCommand(checkCmd)
|
|
rootCmd.AddCommand(getTestCmd())
|
|
rootCmd.AddCommand(getTestInitCmd())
|
|
rootCmd.AddCommand(getRunCmd())
|
|
|
|
if err := rootCmd.Execute(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|