2025-04-16 16:18:40 -04:00
|
|
|
/*
|
|
|
|
Copyright © 2025 Jake jake.young.dev@gmail.com
|
|
|
|
*/
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2025-06-17 23:12:49 -04:00
|
|
|
"code.jakeyoungdev.com/jake/mctl/cmd/command"
|
|
|
|
srv "code.jakeyoungdev.com/jake/mctl/cmd/server"
|
2025-04-16 16:18:40 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// rootCmd represents the base command when called without any subcommands
|
|
|
|
var rootCmd = &cobra.Command{
|
2025-04-16 16:43:58 -04:00
|
|
|
Use: "mctl",
|
|
|
|
Short: "A remote console client",
|
|
|
|
Long: `mctl is a terminal-friendly remote console client made to manage game servers.`,
|
2025-06-19 18:03:53 -04:00
|
|
|
Version: "v0.5.1",
|
2025-04-16 16:18:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
|
|
func Execute() {
|
|
|
|
err := rootCmd.Execute()
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2025-05-11 00:36:11 -04:00
|
|
|
rootCmd.CompletionOptions = cobra.CompletionOptions{
|
|
|
|
DisableDefaultCmd: true,
|
|
|
|
}
|
2025-06-17 23:12:49 -04:00
|
|
|
rootCmd.AddCommand(srv.ServerCmd)
|
|
|
|
rootCmd.AddCommand(command.CommandCmd) //the word command is in this four times, that can't be good.
|
2025-04-16 16:18:40 -04:00
|
|
|
}
|