Updated argument count validation

This commit is contained in:
2025-03-12 16:46:05 -04:00
parent bb3b866b77
commit d2bce37935

View File

@@ -64,7 +64,7 @@ func main() {
// 2. Build NFA from postfix representation (Thompson's algorithm)
// 3. Run the string against the NFA
if len(flag.Args()) != 1 { // flag.Args() also strips out program name
if len(flag.Args()) < 1 || len(flag.Args()) > 2 { // flag.Args() also strips out program name
fmt.Println("ERROR: Missing cmdline args")
os.Exit(22)
}