Remove deprecated --argfile option
This commit is contained in:
1 parent
bb8221efdc
commit
a29ac81de1
3 files changed
+2
-25
No files matched your search
@@ -257,14 +257,6 @@ sections:
|
|||||||
available in the program and has a string whose contents are to the texts
|
available in the program and has a string whose contents are to the texts
|
||||||
in the file named `bar`.
|
in the file named `bar`.
|
||||||
|
|
||||||
* `--argfile variable-name filename`:
|
|
||||||
|
|
||||||
Do not use. Use `--slurpfile` instead.
|
|
||||||
|
|
||||||
(This option is like `--slurpfile`, but when the file has just
|
|
||||||
one text, then that is used, else an array of texts is used as
|
|
||||||
in `--slurpfile`.)
|
|
||||||
|
|
||||||
* `--args`:
|
* `--args`:
|
||||||
|
|
||||||
Remaining arguments are positional string arguments. These are
|
Remaining arguments are positional string arguments. These are
|
||||||
|
|||||||
Generated
-9
@@ -196,15 +196,6 @@ This option reads all the JSON texts in the named file and binds an array of the
|
|||||||
This option reads in the named file and binds its contents to the given global variable\. If you run jq with \fB\-\-rawfile foo bar\fR, then \fB$foo\fR is available in the program and has a string whose contents are to the texts in the file named \fBbar\fR\.
|
This option reads in the named file and binds its contents to the given global variable\. If you run jq with \fB\-\-rawfile foo bar\fR, then \fB$foo\fR is available in the program and has a string whose contents are to the texts in the file named \fBbar\fR\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-argfile variable\-name filename\fR:
|
|
||||||
.
|
|
||||||
.IP
|
|
||||||
Do not use\. Use \fB\-\-slurpfile\fR instead\.
|
|
||||||
.
|
|
||||||
.IP
|
|
||||||
(This option is like \fB\-\-slurpfile\fR, but when the file has just one text, then that is used, else an array of texts is used as in \fB\-\-slurpfile\fR\.)
|
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-\-args\fR:
|
\fB\-\-args\fR:
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
|
|||||||
+2
-8
@@ -521,14 +521,11 @@ int main(int argc, char* argv[]) {
|
|||||||
i += 2; // skip the next two arguments
|
i += 2; // skip the next two arguments
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isoption(argv[i], 0, "argfile", &short_opts) ||
|
if (isoption(argv[i], 0, "rawfile", &short_opts) ||
|
||||||
isoption(argv[i], 0, "rawfile", &short_opts) ||
|
|
||||||
isoption(argv[i], 0, "slurpfile", &short_opts)) {
|
isoption(argv[i], 0, "slurpfile", &short_opts)) {
|
||||||
int raw = isoption(argv[i], 0, "rawfile", &short_opts);
|
int raw = isoption(argv[i], 0, "rawfile", &short_opts);
|
||||||
const char *which;
|
const char *which;
|
||||||
if (isoption(argv[i], 0, "argfile", &short_opts))
|
if (raw)
|
||||||
which = "argfile";
|
|
||||||
else if (raw)
|
|
||||||
which = "rawfile";
|
which = "rawfile";
|
||||||
else
|
else
|
||||||
which = "slurpfile";
|
which = "slurpfile";
|
||||||
@@ -546,9 +543,6 @@ int main(int argc, char* argv[]) {
|
|||||||
ret = JQ_ERROR_SYSTEM;
|
ret = JQ_ERROR_SYSTEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (strcmp(which, "argfile") == 0 &&
|
|
||||||
jv_get_kind(data) == JV_KIND_ARRAY && jv_array_length(jv_copy(data)) == 1)
|
|
||||||
data = jv_array_get(data, 0);
|
|
||||||
program_arguments = jv_object_set(program_arguments, jv_string(argv[i+1]), data);
|
program_arguments = jv_object_set(program_arguments, jv_string(argv[i+1]), data);
|
||||||
}
|
}
|
||||||
i += 2; // skip the next two arguments
|
i += 2; // skip the next two arguments
|
||||||
|
|||||||
Reference in new issue
Block a user