From d8a0393fe178d7d64aa38fc4e324dd3806f73236 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 12 Feb 2024 00:06:51 +0100 Subject: [PATCH] print help text to stdout instead of stderr I looked it up and it would make sense to print it to stdout if the user explicitly wants the help and to stderr if it's not intentional --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index c87787b..23f5ed7 100644 --- a/src/main.c +++ b/src/main.c @@ -50,11 +50,11 @@ int main(int argc, char *argv[]) { } if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { - fprintf(stderr, "%s: modular fetch [%s]\n", PNAME, svtoa(VERSION)); - fprintf(stderr, "\n"); - fprintf(stderr, "OPTIONS\n"); - fprintf(stderr, "\t-h, --help\t\t\tdisplays this help text\n"); - fprintf(stderr, "\t-c, --config /path/to/config\tchanges config path from the default ($XDG_CONFIG_HOME/%s.conf)\n", PNAME); + printf("%s: modular fetch [%s]\n", PNAME, svtoa(VERSION)); + printf("\n"); + printf("OPTIONS\n"); + printf("\t-h, --help\t\t\tdisplays this help text\n"); + printf("\t-c, --config /path/to/config\tchanges config path from the default ($XDG_CONFIG_HOME/%s.conf)\n", PNAME); exit(EXIT_SUCCESS); } }