feat(args): args_handler error handling and print_usage
This commit is contained in:
parent
234713b6a0
commit
e3785dbd08
4 changed files with 183 additions and 6 deletions
15
src/main.c
15
src/main.c
|
|
@ -1,8 +1,19 @@
|
|||
// all includes
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "utils/args/args.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
struct args_options options;
|
||||
int r = args_handler(argc, argv, &options);
|
||||
if (r != 0)
|
||||
{
|
||||
print_usage(stderr, argv[0]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
args_print(&options);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue