mirror of
https://github.com/wader/fq.git
synced 2024-11-22 07:16:49 +03:00
cli: jq compat, multiple -L
This commit is contained in:
parent
c8f0264682
commit
85d17199de
@ -498,7 +498,7 @@ def _main:
|
||||
short: "-L",
|
||||
long: "--include-path",
|
||||
description: "Include search path",
|
||||
string: "PATH"
|
||||
array: "PATH"
|
||||
},
|
||||
"null_output": {
|
||||
short: "-0",
|
||||
@ -650,9 +650,7 @@ def _main:
|
||||
else
|
||||
# use _finally as display etc prints and results in empty
|
||||
_finally(
|
||||
( _include_paths([
|
||||
$opts.include_path // empty
|
||||
]) as $_
|
||||
( _include_paths($opts.include_path) as $_
|
||||
| _input_filenames($opts.filenames) as $_ # store inputs
|
||||
| ( def _inputs:
|
||||
( if $opts.null_input then null
|
||||
|
4
pkg/interp/testdata/incudepath.fqtest
vendored
4
pkg/interp/testdata/incudepath.fqtest
vendored
@ -2,6 +2,10 @@
|
||||
def a: "a";
|
||||
$ fq -L /library -n 'include "a"; a'
|
||||
"a"
|
||||
$ fq --include-path /library -n 'include "a"; a'
|
||||
"a"
|
||||
$ fq -L /wrong -L /library -n 'include "a"; a'
|
||||
"a"
|
||||
$ fq -L /wrong -n 'include "a"; a'
|
||||
exitcode: 3
|
||||
stderr:
|
||||
|
Loading…
Reference in New Issue
Block a user