mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
add set colors command to assist remote console
This commit is contained in:
parent
b2af85a445
commit
26e1d57e8c
3 changed files with 35 additions and 1 deletions
33
phpdbg_set.c
33
phpdbg_set.c
|
@ -57,7 +57,9 @@ PHPDBG_SET(break) /* {{{ */
|
|||
}
|
||||
break;
|
||||
|
||||
phpdbg_default_switch_case();
|
||||
default:
|
||||
phpdbg_error(
|
||||
"set break used incorrectly: set break <on|off>");
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
@ -71,6 +73,7 @@ PHPDBG_SET(color) /* {{{ */
|
|||
input->argv[2]->string, input->argv[2]->length TSRMLS_CC);
|
||||
int element = PHPDBG_COLOR_INVALID;
|
||||
|
||||
/* @TODO(anyone) make this consistent with other set commands */
|
||||
if (color) {
|
||||
if (phpdbg_argv_is(1, "prompt")) {
|
||||
phpdbg_notice(
|
||||
|
@ -105,6 +108,34 @@ usage:
|
|||
}
|
||||
return SUCCESS;
|
||||
} /* }}} */
|
||||
|
||||
PHPDBG_SET(colors) /* {{{ */
|
||||
{
|
||||
switch (param->type) {
|
||||
case EMPTY_PARAM: {
|
||||
phpdbg_writeln(
|
||||
"%s", PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "on" : "off");
|
||||
goto done;
|
||||
}
|
||||
|
||||
case STR_PARAM: {
|
||||
if (strncasecmp(param->str, PHPDBG_STRL("on")) == 0) {
|
||||
PHPDBG_G(flags) |= PHPDBG_IS_COLOURED;
|
||||
goto done;
|
||||
} else if (strncasecmp(param->str, PHPDBG_STRL("off")) == 0) {
|
||||
PHPDBG_G(flags) &= ~PHPDBG_IS_COLOURED;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usage:
|
||||
phpdbg_error(
|
||||
"set colors used incorrectly: set colors <on|off>");
|
||||
|
||||
done:
|
||||
return SUCCESS;
|
||||
} /* }}} */
|
||||
#endif
|
||||
|
||||
PHPDBG_SET(oplog) /* {{{ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue