From 3c867bd5aad1400b3b8cdbf6e1b0bc7310cf8a63 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Tue, 24 Apr 2018 18:26:53 -0700 Subject: [PATCH] Changed usage to work more how it should --- src/common.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/common.c b/src/common.c index 6e5c228..fead469 100644 --- a/src/common.c +++ b/src/common.c @@ -22,29 +22,27 @@ #include _Noreturn void usage(int exit_val){ - fprintf(stderr, "Usage: rexbacklight [argument] [options] [argument]\n\n"); + printf("Usage: rexbacklight [argument] [options] [argument]\n\n"); - fprintf(stderr, "Options:\n"); + printf("Options:\n"); for(int i = 0;i < rexbacklight_args_length;i++){ - fprintf(stderr, " %s|%s\n", rexbacklight_args[i].lopt, rexbacklight_args[i].sopt); - fprintf(stderr, " %s\n", rexbacklight_args[i].desc); + printf(" %s|%s\n", rexbacklight_args[i].lopt, rexbacklight_args[i].sopt); + printf(" %s\n", rexbacklight_args[i].desc); } - fprintf(stderr, "\n"); - fprintf(stderr, "Arguments:\n"); - fprintf(stderr, " =\n"); - fprintf(stderr, " -\n"); - fprintf(stderr, " +\n"); - fprintf(stderr, " off\n"); - fprintf(stderr, " max\n"); - fprintf(stderr, " min\n"); + printf("\n"); + printf("Arguments:\n"); + printf(" =\n"); + printf(" -\n"); + printf(" +\n"); + printf(" off\n"); + printf(" max\n"); + printf(" min\n"); - if(exit_val == RETVAL_SUCCESS){ - fprintf(stderr, "\nrexbacklight Copyright (C) 2018 rexy712\n"); - fprintf(stderr, "This program comes with ABSOLUTELY NO WARRANTY.\n"); - fprintf(stderr, "This is free software, and you are welcome to redistribute it\n"); - fprintf(stderr, "under certain conditions; see the GNU GPLv3 for details.\n"); - fprintf(stderr, "A copy of the GPLv3 is available with the source in the file 'LICENSE'\n"); - } + printf("\nrexbacklight Copyright (C) 2018 rexy712\n"); + printf("This program comes with ABSOLUTELY NO WARRANTY.\n"); + printf("This is free software, and you are welcome to redistribute it\n"); + printf("under certain conditions; see the GNU GPLv3 for details.\n"); + printf("A copy of the GPLv3 is available with the source in the file 'LICENSE'\n"); exit(exit_val); }