CHashTable 1
Loading...
Searching...
No Matches
argument_parser_internal.h
Go to the documentation of this file.
1
6#ifndef CHASHTABLE_ARGUMENT_PARSER_INTERNAL_H
7#define CHASHTABLE_ARGUMENT_PARSER_INTERNAL_H
8
9#include "interactive_mode.h"
10#include "../fprintf_color/fprintf_color.h"
11
12constexpr size_t MAX_CMD_LEN = 128;
13constexpr char DELIMITERS[] = " \t\r\n";
14constexpr size_t CMD_COUNT = 8;
15
17typedef struct {
18 const char cmd_name[16];
19 Command result_value;
21
23constexpr CommandMap command_table[CMD_COUNT] = {
24 {"add", CMD_ADD},
25 {"get", CMD_GET},
26 {"del", CMD_DEL},
27 {"save", CMD_SAVE},
28 {"load", CMD_LOAD},
29 {"print", CMD_PRINT},
30 {"exit", CMD_EXIT},
31 {"help", CMD_HELP}
32};
33
34#endif //CHASHTABLE_ARGUMENT_PARSER_INTERNAL_H
constexpr CommandMap command_table[CMD_COUNT]
Maps command string to enum.
Definition argument_parser_internal.h:23
Argument parser API for interactive mode.
Command
Interactive mode commands.
Definition interactive_mode.h:21
Maps command string to enum.
Definition argument_parser_internal.h:17