feat(landerctl): started custom cli tool; wrote config parser
This commit is contained in:
parent
13b20715bf
commit
49c4c78242
7 changed files with 312 additions and 53 deletions
23
landerctl/include/landerctl.h
Normal file
23
landerctl/include/landerctl.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef LANDERCTL
|
||||
#define LANDERCTL
|
||||
|
||||
typedef struct landerctl_cfg {
|
||||
const char *api_key;
|
||||
} landerctl_cfg;
|
||||
|
||||
typedef enum landerctl_cfg_err {
|
||||
landerctl_cfg_err_ok = 0,
|
||||
landerctl_cfg_err_not_found,
|
||||
landerctl_cfg_err_invalid,
|
||||
landerctl_cfg_err_incomplete,
|
||||
} landerctl_cfg_err;
|
||||
|
||||
/**
|
||||
* Try to parse the required config arguments from the config file
|
||||
*
|
||||
* @param out config to write values to. Existing values are overwritten
|
||||
* @param path path to config file
|
||||
*/
|
||||
landerctl_cfg_err landerctl_cfg_parse(landerctl_cfg *out, const char *path);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue