diff options
| author | yuzu-eva <stevenhu@web.de> | 2024-12-19 17:58:21 +0100 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2024-12-19 17:58:21 +0100 |
| commit | 99425e48e1c53595a9ff4d66c819c6d46c6d2bdc (patch) | |
| tree | 3f01ddf49bfa38c99dbeb8d492475ffbf3a6ded2 /main.c | |
| parent | b411238e832803b037206ddc3355e6795a7ac659 (diff) | |
added help flag -h
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -26,6 +26,7 @@ void print_help() printf(" -s <name> Search for a specific anime by name \n"); printf(" -a <name> <number> Append new anime and episode to file \n"); printf(" -e <name> <number> Edit the episode number of an anime \n"); + printf(" -h Print this help menu \n"); printf("\n"); } @@ -204,12 +205,13 @@ int main(int argc, char **argv) { mode_e mode; int opt; - while ((opt = getopt(argc, argv, "msae")) != -1) { + while ((opt = getopt(argc, argv, "msaeh")) != -1) { switch (opt) { case 'm': mode = MATCH_MODE; break; case 's': mode = SEARCH_MODE; break; case 'a': mode = APPEND_MODE; break; case 'e': mode = EDIT_MODE; break; + case 'h': print_help(); exit(EXIT_SUCCESS); default: print_help(); exit(EXIT_FAILURE); |
