From: Dmitry Volyntsev Date: Fri, 1 Mar 2024 02:56:13 +0000 (-0800) Subject: Shell: revert -t option back to preserve backward compatibility. X-Git-Tag: 0.8.4~21 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=90690123c9cc19053cd78ffd398e266c92dad413;p=njs.git Shell: revert -t option back to preserve backward compatibility. The issue was introduced in cb3e068a511c. --- diff --git a/external/njs_shell.c b/external/njs_shell.c index d5bc9bd7..8ac1b3d7 100644 --- a/external/njs_shell.c +++ b/external/njs_shell.c @@ -726,6 +726,22 @@ njs_options_parse(njs_opts_t *opts, int argc, char **argv) opts->sandbox = 1; break; + case 't': + if (++i < argc) { + if (strcmp(argv[i], "module") == 0) { + opts->module = 1; + + } else if (strcmp(argv[i], "script") != 0) { + njs_stderror("option \"-t\" unexpected source type: %s\n", + argv[i]); + return NJS_ERROR; + } + + break; + } + + njs_stderror("option \"-t\" requires source type\n"); + return NJS_ERROR; case 'v': case 'V': opts->version = 1;