1
1
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:
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", 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

View File

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