Aliases and argument parser

This commit is contained in:
2023-10-21 18:57:09 +01:00
parent ac19a69379
commit fb4a2946b7
3 changed files with 66 additions and 0 deletions

19
src/argparse.c Normal file
View File

@@ -0,0 +1,19 @@
#include "argparse.h"
#include <stdbool.h>
#include <stdlib.h>
argparser_t parse_args(i32 argc, char *argv[]) {
if (argc != 3) {
return (argparser_t){0};
}
argparser_t output = {
.succeeded = true,
.args = (pckr_args_t){0},
};
realpath(argv[1], output.args.dir);
realpath(argv[2], output.args.output);
return output;
}