@@ -84,9 +84,11 @@ using some command-line options:
84
84
85
85
## General options
86
86
87
- * ` -f filename ` / ` --from-file filename ` :
87
+ * ` -f ` / ` --from-file ` :
88
88
89
- Read filter from the file rather than from a command line, like awk's ` -f ` option.
89
+ Read filter from a file rather than from the command line, like awk's ` -f ` option.
90
+ This changes the filter argument to be interpreted as a filename,
91
+ instead of the source of a program.
90
92
91
93
* ` -L directory ` :
92
94
@@ -2954,7 +2956,7 @@ when writing the "shebang" for a jq script:
2954
2956
# total - Output the sum of the given arguments (or stdin)
2955
2957
# usage: total [numbers...]
2956
2958
# \
2957
- exec jq --args -MRnf "$0" -- "$@"
2959
+ exec jq --args -MRnf -- "$0" "$@"
2958
2960
2959
2961
$ARGS.positional |
2960
2962
reduce (
@@ -2974,7 +2976,7 @@ But it is not ignored by `sh`, since in `sh` a backslash at the
2974
2976
end of the line does not continue the comment.
2975
2977
With this trick, when the script is invoked as ` total 1 2 ` ,
2976
2978
` /bin/sh -- /path/to/total 1 2 ` will be run, and ` sh ` will then
2977
- run ` exec jq --args -MRnf /path/to/total -- 1 2 ` replacing itself
2979
+ run ` exec jq --args -MRnf -- /path/to/total 1 2 ` replacing itself
2978
2980
with a ` jq ` interpreter invoked with the specified options (` -M ` ,
2979
2981
` -R ` , ` -n ` , ` --args ` ), that evaluates the current file (` $0 ` ),
2980
2982
with the arguments (` $@ ` ) that were passed to ` sh ` .
0 commit comments