nxt_int_t disassemble;
nxt_int_t interactive;
nxt_int_t sandbox;
+ nxt_int_t quiet;
} njs_opts_t;
"Interactive njs shell.\n"
"\n"
"Options:\n"
- " -v print njs version and exit.\n"
" -d print disassembled code.\n"
+ " -q disable interactive introduction prompt.\n"
" -s sandbox mode.\n"
+ " -v print njs version and exit.\n"
" <filename> | - run code from a file or stdin.\n";
ret = NXT_DONE;
opts->disassemble = 1;
break;
- case 'v':
- case 'V':
- opts->version = 1;
+ case 'q':
+ opts->quiet = 1;
break;
case 's':
opts->sandbox = 1;
break;
+ case 'v':
+ case 'V':
+ opts->version = 1;
+ break;
+
default:
fprintf(stderr, "Unknown argument: \"%s\" "
"try \"%s -h\" for available options\n", argv[i], argv[0]);
return NXT_ERROR;
}
- printf("interactive njs %s\n\n", NJS_VERSION);
+ if (!opts->quiet) {
+ printf("interactive njs %s\n\n", NJS_VERSION);
- printf("v.<Tab> -> the properties and prototype methods of v.\n");
- printf("type console.help() for more information\n\n");
+ printf("v.<Tab> -> the properties and prototype methods of v.\n");
+ printf("type console.help() for more information\n\n");
+ }
for ( ;; ) {
line.start = (u_char *) readline(">> ");