Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check -- terminator on --mfrom #1098

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/pkg/cli/option_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions test/cases/cli-mfrom/0003/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr --csv --mfrom test/input/s.csv test/input/t.csv cat
1 change: 1 addition & 0 deletions test/cases/cli-mfrom/0003/experr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mlr: "--mfrom" must be terminated by "--".
Empty file.
Empty file.