INNER CODE UNIT · Go
main
openkruise/kruise · hack/calculator-helper/validator/main.go:11
func main() {
// Command-line flags
expression := flag.String("expr", "", "Expression to validate and plot (required)")
variable := flag.String("var", "cpu", "Variable to plot against (cpu or memory)")
minValue := flag.String("min", "0", "Minimum value for the variable (k8s quantity, e.g., 0, 100m, 1Gi)")
maxValue := flag.String("max", "16", "Maximum value for the variable (k8s quantity, e.g., 16, 8000m, 4Gi)")
output := flag.String("output", "", "Output file path for the plot (e.g., plot.png)")
validateOnly := flag.Bool("validate", false, "Only validate the expression without plotting")
flag.Parse()
// Check if expression is provided
if *expression == "" {
fmt.Println("Error: expression is required")
flag.Usage()
os.Exit(1)
}