package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "isolator",
Short: "A CLI tool to securely execute code in isolated environments",
Long: `Isolator provides a way to run code snippets (Python, Go, JavaScript)
within secure, ephemeral Docker containers, enforcing resource limits and timeouts.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// 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 {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
os.Exit(1)
}
}
func init() {
// Flags defined in run.go are added to rootCmd via rootCmd.AddCommand(runCmd) in run.go's init()
}