]> git.kaiwu.me - njs.git/commitdiff
Shell: avoid reporting filenames in exception is quiet mode.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 8 Feb 2019 17:14:55 +0000 (20:14 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 8 Feb 2019 17:14:55 +0000 (20:14 +0300)
njs/njs_shell.c

index 26a24ade33513958ce11cc81c600412c4ea60afd..3b72c079f0cc594e824b631368c592495a9562e7 100644 (file)
@@ -214,11 +214,13 @@ main(int argc, char **argv)
 
     nxt_memzero(&vm_options, sizeof(njs_vm_opt_t));
 
-    if (opts.file != NULL) {
-        nxt_file_name(&vm_options.file, opts.file);
+    if (!opts.quiet) {
+        if (opts.file != NULL) {
+            nxt_file_name(&vm_options.file, opts.file);
 
-    } else {
-        vm_options.file = nxt_string_value("shell");
+        } else {
+            vm_options.file = nxt_string_value("shell");
+        }
     }
 
     vm_options.init = !opts.interactive;