mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Let + be an alias for then (#1049)
This commit is contained in:
parent
23aefb5646
commit
418f6d80aa
2 changed files with 4 additions and 2 deletions
|
|
@ -21,3 +21,5 @@ GENMD-INCLUDE-ESCAPED(data/then-chaining-performance.txt)
|
|||
There are two reasons to use then-chaining: one is for performance, although I don't expect this to be a win in all cases. Using then-chaining avoids redundant string-parsing and string-formatting at each pipeline step: instead input records are parsed once, they are fed through each pipeline stage in memory, and then output records are formatted once.
|
||||
|
||||
The other reason to use then-chaining is for simplicity: you don't have re-type formatting flags (e.g. `--csv --fs tab`) at every pipeline stage.
|
||||
|
||||
As of Miller 6.3.0, `+` is an alias for `then`.
|
||||
|
|
|
|||
|
|
@ -162,10 +162,10 @@ func parseCommandLinePassOne(
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
} else if onFirst || args[argi] == "then" {
|
||||
} else if onFirst || args[argi] == "then" || args[argi] == "+" {
|
||||
// The first verb in the then-chain can *optionally* be preceded by
|
||||
// 'then'. The others one *must* be.
|
||||
if args[argi] == "then" {
|
||||
if args[argi] == "then" || args[argi] == "+" {
|
||||
cli.CheckArgCount(args, argi, argc, 1)
|
||||
oargi++
|
||||
argi++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue