Skip to content

Commit

Permalink
interp: Refactor repl inputs a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Sep 12, 2021
1 parent 86b34a3 commit 54e121c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/interp/interp.jq
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,11 @@ def _main:
]) as $_
| _input_filenames($filenames) as $_ # store inputs
| if $parsed_args.repl then
( if $null_input then [null]
elif $parsed_args.slurp then [[inputs]]
else [inputs]
end
( [ if $null_input then null
elif $parsed_args.slurp then [inputs]
else inputs
end
]
| ( [.[] | _cli_expr_eval($expr; $expr_filename)]
| repl({}; .[])
)
Expand Down

0 comments on commit 54e121c

Please sign in to comment.