Skip to content

Commit be4e155

Browse files
rrthomasscop
authored andcommitted
fix(jq): fix treatment of -f|--from-file
That option’s argument is the filter, so the argument should be counted towards the total number of arguments so far. Hence, remove --from-file from the list of options whose argument is counted as an option.
1 parent ca361be commit be4e155

File tree

1 file changed

+2
-1
lines changed
  • completions

1 file changed

+2
-1
lines changed

completions/jq

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ _jq()
4141

4242
local args
4343
# TODO: DTRT with args taking 2 options
44-
_count_args "" "@(--arg|--arg?(json|file)|--?(slurp|from-)file|--indent|--run-tests|-!(-*)[fL])"
44+
# -f|--from-file are not counted here because they supply the filter
45+
_count_args "" "@(--arg|--arg?(json|file)|--slurpfile|--indent|--run-tests|-!(-*)L)"
4546

4647
# 1st arg is filter
4748
((args == 1)) && return

0 commit comments

Comments
 (0)