diff options
author | krakjoe <joe.watkins@live.co.uk> | 2013-11-28 17:02:38 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2013-11-28 17:02:38 +0000 |
commit | 26e1d57e8cfb3b8860ba89b66643e14cbef9edcc (patch) | |
tree | d831a651420628dc6f48707f917814488d46623a /phpdbg_set.c | |
parent | b2af85a445b488aae98d7fc9182ab15b4d34bbfd (diff) | |
download | php-git-26e1d57e8cfb3b8860ba89b66643e14cbef9edcc.tar.gz |
add set colors command to assist remote console
Diffstat (limited to 'phpdbg_set.c')
-rw-r--r-- | phpdbg_set.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/phpdbg_set.c b/phpdbg_set.c index aa24822b9e..be8624ef97 100644 --- a/phpdbg_set.c +++ b/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) /* {{{ */ |