summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--phpdbg_help.c17
-rw-r--r--phpdbg_utils.c5
-rw-r--r--phpdbg_utils.h3
3 files changed, 24 insertions, 1 deletions
diff --git a/phpdbg_help.c b/phpdbg_help.c
index 09f16252d3..263ce6c1c9 100644
--- a/phpdbg_help.c
+++ b/phpdbg_help.c
@@ -450,6 +450,23 @@ PHPDBG_HELP(set) /* {{{ */
++set_command;
}
}
+ phpdbg_notice("Colors");
+ {
+ const phpdbg_color_t *color = phpdbg_get_colors(TSRMLS_C);
+
+ if (PHPDBG_G(flags) & PHPDBG_IS_COLOURED) {
+ phpdbg_writeln("\t%-15s\t\tExample", "Name");
+ } else phpdbg_writeln("\tName");
+
+ while (color && color->name) {
+ if (PHPDBG_G(flags) & PHPDBG_IS_COLOURED) {
+ phpdbg_writeln(
+ "\t%-15s\t\t\033[%smphpdbg rocks :)\033[0m", color->name, color->code);
+ } else phpdbg_writeln("\t%s", color->name);
+
+ ++color;
+ }
+ }
phpdbg_help_footer();
return SUCCESS;
} /* }}} */
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index c234e64d80..ae21cdc78b 100644
--- a/phpdbg_utils.c
+++ b/phpdbg_utils.c
@@ -262,6 +262,11 @@ PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_l
} else PHPDBG_G(colors)[element] = colors;
} /* }}} */
+PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */
+{
+ return colors;
+} /* }}} */
+
PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */
{
/* free formatted prompt */
diff --git a/phpdbg_utils.h b/phpdbg_utils.h
index 399020f534..e9c35d102d 100644
--- a/phpdbg_utils.h
+++ b/phpdbg_utils.h
@@ -96,7 +96,8 @@ typedef struct _phpdbg_color_t {
PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC);
PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC);
-PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC); /* }}} */
+PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC);
+PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D); /* }}} */
/* {{{ Prompt Management */
PHPDBG_API void phpdbg_set_prompt(const char* TSRMLS_DC);