Add status and say to cobra

This commit is contained in:
2026-06-24 13:54:58 -04:00
parent 42453ef16e
commit a0dc720a1e

15
main.go
View File

@@ -53,6 +53,19 @@ var shellCmd = &cobra.Command{
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
} }
var sayCmd = &cobra.Command{
Use: "say",
Short: "Say something in the server",
Run: server.Say,
Args: cobra.MinimumNArgs(1),
}
var statusCMd = &cobra.Command{
Use: "cmd",
Short: "Get the status of the server",
Run: server.Status,
}
//go:embed templates/docker-compose.yml //go:embed templates/docker-compose.yml
var dockerCompose string var dockerCompose string
@@ -73,6 +86,8 @@ func init() {
rootCmd.AddCommand(stopCmd) rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(restartCmd) rootCmd.AddCommand(restartCmd)
rootCmd.AddCommand(shellCmd) rootCmd.AddCommand(shellCmd)
rootCmd.AddCommand(sayCmd)
rootCmd.AddCommand(statusCMd)
t, err := template.New("compose").Parse(dockerCompose) t, err := template.New("compose").Parse(dockerCompose)
if err != nil { if err != nil {