Updated argument count validation

master
Aadhavan Srinivasan 4 weeks ago
parent bb3b866b77
commit d2bce37935

@ -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)
}

Loading…
Cancel
Save