command parser: Add support for the GETVAL command.
[collectd.git] / src / utils_cmds.c
index 7648435..9ff9d4d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "utils_cmds.h"
 #include "utils_cmd_flush.h"
+#include "utils_cmd_getval.h"
 #include "utils_cmd_listval.h"
 #include "utils_cmd_putval.h"
 #include "utils_parse_option.h"
@@ -214,6 +215,12 @@ cmd_status_t cmd_parsev (size_t argc, char **argv,
                return cmd_parse_flush (argc - 1, argv + 1,
                                &ret_cmd->cmd.flush, err);
        }
+       else if (strcasecmp ("GETVAL", command) == 0)
+       {
+               ret_cmd->type = CMD_GETVAL;
+               return cmd_parse_getval (argc - 1, argv + 1,
+                               &ret_cmd->cmd.getval, err);
+       }
        else if (strcasecmp ("LISTVAL", command) == 0)
        {
                ret_cmd->type = CMD_LISTVAL;
@@ -265,6 +272,9 @@ void cmd_destroy (cmd_t *cmd)
                case CMD_FLUSH:
                        cmd_destroy_flush (&cmd->cmd.flush);
                        break;
+               case CMD_GETVAL:
+                       cmd_destroy_getval (&cmd->cmd.getval);
+                       break;
                case CMD_LISTVAL:
                        cmd_destroy_listval (&cmd->cmd.listval);
                        break;