mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Bash process substitution not working with put -f (#1583)
* Bash process substitution not working with `put -f` * run `make dev`
This commit is contained in:
parent
dc21fa3cd5
commit
6520bf4758
5 changed files with 26 additions and 12 deletions
|
|
@ -3731,5 +3731,5 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2024-06-08 4mMILLER24m(1)
|
||||
2024-06-09 4mMILLER24m(1)
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -3710,4 +3710,4 @@
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2024-06-08 4mMILLER24m(1)
|
||||
2024-06-09 4mMILLER24m(1)
|
||||
|
|
|
|||
|
|
@ -3710,4 +3710,4 @@
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2024-06-08 4mMILLER24m(1)
|
||||
2024-06-09 4mMILLER24m(1)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
.\" Title: mlr
|
||||
.\" Author: [see the "AUTHOR" section]
|
||||
.\" Generator: ./mkman.rb
|
||||
.\" Date: 2024-06-08
|
||||
.\" Date: 2024-06-09
|
||||
.\" Manual: \ \&
|
||||
.\" Source: \ \&
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "MILLER" "1" "2024-06-08" "\ \&" "\ \&"
|
||||
.TH "MILLER" "1" "2024-06-09" "\ \&" "\ \&"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Portability definitions
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -247,14 +247,28 @@ func transformerPutOrFilterParseCLI(
|
|||
} else if opt == "-f" {
|
||||
// Get a DSL string from the user-specified filename
|
||||
filename := cli.VerbGetStringArgOrDie(verb, opt, args, &argi, argc)
|
||||
theseDSLStrings, err := lib.LoadStringsFromFileOrDir(filename, ".mlr")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s %s: cannot load DSL expression from file \"%s\": ",
|
||||
"mlr", verb, filename)
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
||||
// Miller has a two-pass command-line parser. If the user does
|
||||
// `mlr put -f foo.mlr`
|
||||
// then that file can be parsed both times. But if the user does
|
||||
// `mlr put -f <( echo 'some expression goes here' )`
|
||||
// that will read stdin. (The filename will come in as "dev/fd/63" or what have you.)
|
||||
// But this file _cannot_ be read twice. So, if doConstruct==false -- we're
|
||||
// on the first pass of the command-line parser -- don't bother to parse
|
||||
// the DSL-contents file.
|
||||
//
|
||||
// See also https://github.com/johnkerl/miller/issues/1515
|
||||
|
||||
if doConstruct {
|
||||
theseDSLStrings, err := lib.LoadStringsFromFileOrDir(filename, ".mlr")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s %s: cannot load DSL expression from file \"%s\": ",
|
||||
"mlr", verb, filename)
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
dslStrings = append(dslStrings, theseDSLStrings...)
|
||||
}
|
||||
dslStrings = append(dslStrings, theseDSLStrings...)
|
||||
haveDSLStringsHere = true
|
||||
|
||||
} else if opt == "-e" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue