diff options
| author | hachem <im@hachem.wtf> | 2026-08-30 00:59:52 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-30 00:59:52 +0200 |
| commit | 11d3e0294d6c4d657c45c6f8de23dd628b61680d (patch) | |
| tree | f58b7b57efe3447dbbe0f07fd47c30a8fc5d44e7 /src/main.c | |
| parent | cd04e59647a9440e6b362b3a46b36f46bf2b2576 (diff) | |
add: command-line argument parser
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -1,6 +1,22 @@ #include <stdio.h> -int main(void) +#include "cli/args.h" + +int main(int argc, char** argv) { - puts("type shi"); + struct Args args; + + enum ParseResult result = parse_args(argc, argv, &args); + if (result == PARSE_EXIT) + return 0; + if (result == PARSE_ERROR) + return 1; + + static const char* target_names[] = { "nasm", "fasm", "masm" }; + + printf("input: %s\n", args.input_path); + printf("output: %s\n", args.output_path != NULL ? args.output_path : "<stdout>"); + printf("target: %s\n", target_names[args.target]); + + return 0; } |
