Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated --argfile option #2768

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/content/manual/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,6 @@ sections:
available in the program and has a string whose contents are to the texts
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`:

Remaining arguments are positional string arguments. These are
Expand Down
9 changes: 0 additions & 9 deletions jq.1.prebuilt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,11 @@ int main(int argc, char* argv[]) {
i += 2; // skip the next two arguments
continue;
}
if (isoption(argv[i], 0, "argfile", &short_opts) ||
isoption(argv[i], 0, "rawfile", &short_opts) ||
if (isoption(argv[i], 0, "rawfile", &short_opts) ||
isoption(argv[i], 0, "slurpfile", &short_opts)) {
int raw = isoption(argv[i], 0, "rawfile", &short_opts);
const char *which;
if (isoption(argv[i], 0, "argfile", &short_opts))
which = "argfile";
else if (raw)
if (raw)
which = "rawfile";
else
which = "slurpfile";
Expand All @@ -546,9 +543,6 @@ int main(int argc, char* argv[]) {
ret = JQ_ERROR_SYSTEM;
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);
}
i += 2; // skip the next two arguments
Expand Down