Changed usage to work more how it should

This commit is contained in:
rexy712 2018-04-24 18:26:53 -07:00
parent b141fbdb2b
commit 3c867bd5aa

View File

@ -22,29 +22,27 @@
#include <stdio.h>
_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, " =<percentage>\n");
fprintf(stderr, " -<percentage>\n");
fprintf(stderr, " +<percentage>\n");
fprintf(stderr, " off\n");
fprintf(stderr, " max\n");
fprintf(stderr, " min\n");
printf("\n");
printf("Arguments:\n");
printf(" =<percentage>\n");
printf(" -<percentage>\n");
printf(" +<percentage>\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);
}