From d8c79f459c1cbab9f0fd9d5859d0680ef4e41111 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 8 Feb 2019 20:14:55 +0300 Subject: [PATCH] Shell: avoid reporting filenames in exception is quiet mode. --- njs/njs_shell.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/njs/njs_shell.c b/njs/njs_shell.c index 26a24ade..3b72c079 100644 --- a/njs/njs_shell.c +++ b/njs/njs_shell.c @@ -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; -- 2.47.3