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