[njs] Shell: revert -t option back to preserve backward compatibility.

Dmitry Volyntsev xeioex at nginx.com
Fri Mar 1 04:54:02 UTC 2024


details:   https://hg.nginx.org/njs/rev/d7a0bbcba46e
branches:  
changeset: 2294:d7a0bbcba46e
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Feb 29 18:56:13 2024 -0800
description:
Shell: revert -t option back to preserve backward compatibility.

The issue was introduced in cb3e068a511c.

diffstat:

 external/njs_shell.c |  16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 49417e2749e0 -r d7a0bbcba46e external/njs_shell.c
--- a/external/njs_shell.c	Tue Feb 27 23:25:11 2024 -0800
+++ b/external/njs_shell.c	Thu Feb 29 18:56:13 2024 -0800
@@ -726,6 +726,22 @@ njs_options_parse(njs_opts_t *opts, int 
             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;


More information about the nginx-devel mailing list