Przeglądaj źródła

Better message on help and failure with -n.

tags/v20240302
Emil 8 miesięcy temu
rodzic
commit
1707803ff7
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 5432DB986FDBCF8A
1 zmienionych plików z 8 dodań i 2 usunięć
  1. +8
    -2
      baked.c

+ 8
- 2
baked.c Wyświetl plik

@@ -36,6 +36,9 @@
#endif

#define DESC \
"Options [Must always be first]\n" \
"\t-h, this message, -n dryrun\n" \
"In-file expansions\n" \
"\t$@ returns target-file\n" \
"\t$* returns target-file without suffix\n" \
"\t$+ returns arguments\n"
@@ -290,7 +293,7 @@ main(int argc, char ** argv)

if (argc < 2
|| !strcmp(argv[1], "-h"))
{ fprintf(stderr, "%s: %s", argv[0], HELP DESC); return 1; }
{ goto help; }

g_filename = argv[1];

@@ -299,7 +302,7 @@ main(int argc, char ** argv)
if (argc > 2)
{ ret = 1; g_filename = argv[2]; }
else
{ return 1; }
{ goto help; }
}

buf = find_region(g_filename);
@@ -321,4 +324,7 @@ main(int argc, char ** argv)

free(buf);
return ret;
help:
fprintf(stderr, "%s: %s", argv[0], HELP DESC);
return 1;
}

Ładowanie…
Anuluj
Zapisz