Skip to content

Commit

Permalink
Use error_log for logging/printing errors
Browse files Browse the repository at this point in the history
	modified:   src/nms.c
  • Loading branch information
bartobri committed Oct 25, 2018
1 parent d921892 commit 1cd3657
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/nms.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
#include "input.h"
#include "error.h"

#define VERSION "0.3.3"
#define VERSION "0.3.4"

int main(int argc, char *argv[]) {
int main(int argc, char *argv[])
{
int r, o;
unsigned char *input;

input = NULL;

while ((o = getopt(argc, argv, "f:ascv")) != -1) {
switch (o) {
while ((o = getopt(argc, argv, "f:ascv")) != -1)
{
switch (o)
{
case 'f':
nmseffect_set_foregroundcolor(optarg);
break;
Expand All @@ -37,13 +40,18 @@ int main(int argc, char *argv[]) {
break;
case 'v':
printf("nms version " VERSION "\n");
return 0;
return EXIT_SUCCESS;
case '?':
if (isprint(optopt))
fprintf (stderr, "Unknown option '-%c'.\n", optopt);
{
error_log("Unknown option '-%c'.", optopt);
}
else
fprintf (stderr, "Unknown option character '\\x%x'.\n", optopt);
return 1;
{
error_log("Unknown option character '\\x%x'.", optopt);
}
error_print();
return EXIT_FAILURE;
}
}

Expand Down

0 comments on commit 1cd3657

Please sign in to comment.