diff --git a/src/lua/init.c b/src/lua/init.c
index 99616d6a33ce972694248798584bdf78bd52213d..646b7f2f03b46f3d8dd084e6b4792d2292740ba4 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -545,12 +545,12 @@ run_script_f(va_list ap)
 	 */
 	fiber_sleep(0.0);
 
-	if (path && access(path, F_OK) == 0) {
+	if (path && strcmp(path, "-") != 0 && access(path, F_OK) == 0) {
 		/* Execute script. */
 		if (luaL_loadfile(L, path) != 0)
 			panic("%s", lua_tostring(L, -1));
 		lua_main(L, argc, argv);
-	} else if (!isatty(STDIN_FILENO)) {
+	} else if (!isatty(STDIN_FILENO) || (path && strcmp(path, "-") == 0)) {
 		/* Execute stdin */
 		if (luaL_loadfile(L, NULL) != 0)
 			panic("%s", lua_tostring(L, -1));
diff --git a/src/main.cc b/src/main.cc
index a0e187086a422a07f0bc07df480e0d660ce662a1..0d306433df5ed1a006bac9acb0118b31ecb02e94 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -481,8 +481,6 @@ tarantool_free(void)
 #ifdef ENABLE_GCOV
 	__gcov_flush();
 #endif
-	if (script)
-		free(script);
 	/* tarantool_lua_free() was formerly reponsible for terminal reset,
 	 * but it is no longer called
 	 */
@@ -535,6 +533,8 @@ print_help(const char *program)
 	puts("  -e EXPR\t\t\texecute string 'EXPR'");
 	puts("  -l NAME\t\t\trequire library 'NAME'");
 	puts("  -i\t\t\t\tenter interactive mode after executing 'SCRIPT'");
+	puts("  --\t\t\t\tstop handling options");
+	puts("  -\t\t\t\texecute stdin and stop handling options");
 	puts("");
 	puts("Please visit project home page at http://tarantool.org");
 	puts("to see online documentation, submit bugs or contribute a patch.");
@@ -604,7 +604,7 @@ main(int argc, char **argv)
 	for (int i = 1; i < argc; i++)
 		argv[i] = argv[optind + i - 1];
 
-	if (argc > 1 && access(argv[1], R_OK) != 0) {
+	if (argc > 1 && strcmp(argv[1], "-") && access(argv[1], R_OK) != 0) {
 		/*
 		 * Somebody made a mistake in the file
 		 * name. Be nice: open the file to set
@@ -636,7 +636,7 @@ main(int argc, char **argv)
 	if (argc > 1) {
 		argv++;
 		argc--;
-		script = abspath(argv[0]);
+		script = argv[0];
 		title_set_script_name(argv[0]);
 	}
 
diff --git a/test/box-py/args.result b/test/box-py/args.result
index 3ab6f7b19109f6a816fa5af685eb3e34be67552b..11cc9e65a53e3997cbf440053ce33508713b1a1c 100644
--- a/test/box-py/args.result
+++ b/test/box-py/args.result
@@ -10,6 +10,8 @@ When no script name is provided, the server responds to:
   -e EXPR			execute string 'EXPR'
   -l NAME			require library 'NAME'
   -i				enter interactive mode after executing 'SCRIPT'
+  --				stop handling options
+  -				execute stdin and stop handling options
 
 Please visit project home page at http://tarantool.org
 to see online documentation, submit bugs or contribute a patch.
@@ -26,6 +28,8 @@ When no script name is provided, the server responds to:
   -e EXPR			execute string 'EXPR'
   -l NAME			require library 'NAME'
   -i				enter interactive mode after executing 'SCRIPT'
+  --				stop handling options
+  -				execute stdin and stop handling options
 
 Please visit project home page at http://tarantool.org
 to see online documentation, submit bugs or contribute a patch.