flesh out yaml parser.
This commit is contained in:
parent
0485a7242d
commit
71385a1fd5
8 changed files with 250 additions and 6 deletions
11
main.c
11
main.c
|
|
@ -18,14 +18,15 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define ARG_L_CONFIG_PATH "--config"
|
||||
#define ARG_S_CONFIG_PATH "-c"
|
||||
|
||||
#define ARG_LEN_L_CONFIG_PATH 8
|
||||
#define ARG_LEN_S_CONFIG_PATH 2
|
||||
|
||||
char configPath[1024];
|
||||
size_t configPathLength = 0;
|
||||
Config *config = NULL;
|
||||
|
||||
int parseArguments(int, char**);
|
||||
void printHelp(void);
|
||||
|
|
@ -42,6 +43,8 @@ int main(int argc, char** argv)
|
|||
|
||||
int parseArguments(int argc, char** argv)
|
||||
{
|
||||
char configPath[1024];
|
||||
size_t configPathLength = 0;
|
||||
bool expectConfigPath = false;
|
||||
|
||||
for (int argIndex = 1; argIndex < argc; argIndex++) {
|
||||
|
|
@ -70,6 +73,10 @@ int parseArguments(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
if (loadConfigFromFile(configPath, configPathLength, &config) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue