diff options
| author | johannes <johannes.herman@gmail.com> | 2024-02-14 23:20:16 +0100 |
|---|---|---|
| committer | johannes <johannes.herman@gmail.com> | 2024-02-14 23:20:16 +0100 |
| commit | 82c9118efb2459bda3ddbe9b5009c2afafce73b9 (patch) | |
| tree | af09cc84eb54a6129fd4458620913f1da2ab3450 /src | |
| parent | 438e03d8ed3da289fd2096760c38e9a6fdf227ac (diff) | |
fixed args not working with full names
Diffstat (limited to 'src')
| -rw-r--r-- | src/args.c | 2 | ||||
| -rw-r--r-- | src/main.c | 5 |
2 files changed, 2 insertions, 5 deletions
@@ -118,7 +118,7 @@ int parseargs(int argc, char *args[]) ARGS = (arg *)realloc(ARGS, argscap * sizeof(arg)); } ARGS[ARGC].type = pa->type; - ARGS[ARGC].flag = a; + ARGS[ARGC].flag = pa->flag; ARGS[ARGC].numopt = pa->numopt; ARGS[ARGC].runarg = pa->runarg; ARGS[ARGC].opts = (char **)malloc(pa->numopt * sizeof(char *)); @@ -151,15 +151,12 @@ int main(int argc, char *argv[]) printf("For more help run 'dedit --help'\n"); } - if (argc == 1) + if (argc == 1 || getopt("-h", 0)) { printhelp(); exit(EXIT_SUCCESS); } - if (getopt("-h", 0)) - printhelp(); - arg *demoarg = getarg(0); if (demoarg == NULL) { |
