Check -- terminator on --mfrom (#1098)

This commit is contained in:
John Kerl 2022-09-28 00:30:05 -04:00 committed by GitHub
parent 0aea51b6fe
commit f131087713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 0 deletions

View file

@ -2722,6 +2722,10 @@ var MiscFlagSection = FlagSection{
options.FileNames = append(options.FileNames, args[*pargi])
*pargi += 1
}
if *pargi >= argc {
fmt.Fprintf(os.Stderr, "mlr: \"--mfrom\" must be terminated by \"--\".\n")
os.Exit(1)
}
if args[*pargi] == "--" {
*pargi += 1
}

View file

@ -0,0 +1 @@
mlr --csv --mfrom test/input/s.csv test/input/t.csv cat

View file

@ -0,0 +1 @@
mlr: "--mfrom" must be terminated by "--".

View file

View file