From 2154be5fab4197fdfa551b5a46cc3b12c4571d2a Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 3 Jul 2008 11:09:53 +0200 Subject: [PATCH] src/rrd_daemon.c: Implemented the `HELP' command. --- src/rrd_daemon.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 7e46dca..7a51f5d 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -601,6 +601,104 @@ static int flush_file (const char *filename) /* {{{ */ return (0); } /* }}} int flush_file */ +static int handle_request_help (int fd, /* {{{ */ + char *buffer, size_t buffer_size) +{ + int status; + char **help_text; + size_t help_text_len; + char *command; + size_t i; + + char *help_help[] = + { + "4 Command overview\n", + "FLUSH \n", + "HELP []\n", + "UPDATE [ ...]\n", + "STATS\n" + }; + size_t help_help_len = sizeof (help_help) / sizeof (help_help[0]); + + char *help_flush[] = + { + "4 Help for FLUSH\n", + "Usage: FLUSH \n", + "\n", + "Adds the given filename to the head of the update queue and returns\n", + "after is has been dequeued.\n" + }; + size_t help_flush_len = sizeof (help_flush) / sizeof (help_flush[0]); + + char *help_update[] = + { + "9 Help for UPDATE\n", + "Usage: UPDATE [ ...]\n" + "\n", + "Adds the given file to the internal cache if it is not yet known and\n", + "appends the given value(s) to the entry. See the rrdcached(1) manpage\n", + "for details.\n", + "\n", + "Each has the following form:\n", + " =