linsk/cmd/root.go

35 lines
631 B
Go
Raw Normal View History

2023-08-25 15:12:19 +01:00
package cmd
import (
"os"
2023-08-25 16:54:58 +01:00
"log/slog"
2023-08-25 15:12:19 +01:00
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
2023-08-26 09:16:52 +01:00
Use: "linsk",
2023-08-25 15:12:19 +01:00
// TODO: Fill this
// Short: "",
// Long: ``,
}
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
2023-08-26 11:27:38 +01:00
var vmDebugFlag bool
2023-08-25 15:12:19 +01:00
func init() {
2023-08-25 16:54:58 +01:00
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, nil)))
2023-08-25 15:12:19 +01:00
rootCmd.AddCommand(lsCmd)
2023-08-25 16:54:58 +01:00
rootCmd.AddCommand(runCmd)
2023-08-26 11:27:38 +01:00
rootCmd.AddCommand(shellCmd)
rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vmdebug", false, "Enable VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.")
2023-08-25 15:12:19 +01:00
}