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
This commit is contained in:
parent
55414046ea
commit
d8a0393fe1
1 changed files with 5 additions and 5 deletions
10
src/main.c
10
src/main.c
|
@ -50,11 +50,11 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
|
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
|
||||||
fprintf(stderr, "%s: modular fetch [%s]\n", PNAME, svtoa(VERSION));
|
printf("%s: modular fetch [%s]\n", PNAME, svtoa(VERSION));
|
||||||
fprintf(stderr, "\n");
|
printf("\n");
|
||||||
fprintf(stderr, "OPTIONS\n");
|
printf("OPTIONS\n");
|
||||||
fprintf(stderr, "\t-h, --help\t\t\tdisplays this help text\n");
|
printf("\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("\t-c, --config /path/to/config\tchanges config path from the default ($XDG_CONFIG_HOME/%s.conf)\n", PNAME);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue