summaryrefslogtreecommitdiff
path: root/phpdbg.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2014-04-21 21:24:41 +0100
committerkrakjoe <joe.watkins@live.co.uk>2014-04-21 21:24:41 +0100
commit0873f2bfb4f8ad0ecd5f4ae7805828ed34bc1565 (patch)
tree6a9287b6a53a83f4fb99312f7bcc384c083f0d85 /phpdbg.c
parentf96feea00c112bc1bec3e7b677218f4b487d1152 (diff)
downloadphp-git-0873f2bfb4f8ad0ecd5f4ae7805828ed34bc1565.tar.gz
remove -e option in favour of taking script from argv[]
Diffstat (limited to 'phpdbg.c')
-rw-r--r--phpdbg.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/phpdbg.c b/phpdbg.c
index 8fde93cd90..d7eb5c8b38 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -569,7 +569,6 @@ const opt_struct OPTIONS[] = { /* {{{ */
{'z', 1, "load zend_extension"},
/* phpdbg options */
{'q', 0, "no banner"},
- {'e', 1, "exec"},
{'v', 0, "disable quietness"},
{'s', 0, "enable stepping"},
{'b', 0, "boring colours"},
@@ -983,16 +982,6 @@ phpdbg_main:
/* begin phpdbg options */
- case 'e': { /* set execution context */
- exec_len = strlen(php_optarg);
- if (exec_len) {
- if (exec) {
- free(exec);
- }
- exec = strdup(php_optarg);
- }
- } break;
-
case 'S': { /* set SAPI name */
if (sapi_name) {
free(sapi_name);
@@ -1083,6 +1072,19 @@ phpdbg_main:
} break;
}
}
+
+ /* set exec if present on command line */
+ if ((argc > php_optind) && (strcmp(argv[php_optind-1],"--") != SUCCESS))
+ {
+ exec_len = strlen(argv[php_optind]);
+ if (exec_len) {
+ if (exec) {
+ free(exec);
+ }
+ exec = strdup(argv[php_optind]);
+ }
+ php_optind++;
+ }
#ifndef _WIN32
/* setup remote server if necessary */