1
1
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:
Mattias Wadman 2021-09-05 13:38:13 +02:00
parent c8f0264682
commit 85d17199de
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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: