diff options
author | Sergey Grebenshchikov <sgreben@gmail.com> | 2018-03-30 22:56:37 +0200 |
---|---|---|
committer | Sergey Grebenshchikov <sgreben@gmail.com> | 2018-03-30 22:57:11 +0200 |
commit | d8f478e6cf5d4246ad58512769faa2a89267f06e (patch) | |
tree | 9f367001c0ad6da0a60c3398bb06418f0e5a7acc /cmd/jp/main.go | |
parent | 152033fc63285a05e9c7a407718d6ebc1896fe64 (diff) |
Accept x/y pair slices, interleave results of union-selection.1.1.9
Diffstat (limited to 'cmd/jp/main.go')
-rw-r--r-- | cmd/jp/main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/jp/main.go b/cmd/jp/main.go index 4f26ecb..6cc9898 100644 --- a/cmd/jp/main.go +++ b/cmd/jp/main.go @@ -97,17 +97,20 @@ func init() { var err error xPattern = jsonpath.New("x") + xPattern.AllowMissingKeys(true) err = xPattern.Parse(fmt.Sprintf("{%s}", config.X)) if err != nil { log.Fatal(err) } yPattern = jsonpath.New("y") + yPattern.AllowMissingKeys(true) err = yPattern.Parse(fmt.Sprintf("{%s}", config.Y)) if err != nil { log.Fatal(err) } - if config.XY != "" { + if config.XY != "" || (config.X == "" && config.Y == "") { xyPattern = jsonpath.New("xy") + xyPattern.AllowMissingKeys(true) err = xyPattern.Parse(fmt.Sprintf("{%s}", config.XY)) if err != nil { log.Fatal(err) |