Use error_log for logging/printing errors
modified: src/nms.c
This commit is contained in:
parent
d921892576
commit
1cd3657415
24
src/nms.c
24
src/nms.c
@ -13,16 +13,19 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "error.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;
|
int r, o;
|
||||||
unsigned char *input;
|
unsigned char *input;
|
||||||
|
|
||||||
input = NULL;
|
input = NULL;
|
||||||
|
|
||||||
while ((o = getopt(argc, argv, "f:ascv")) != -1) {
|
while ((o = getopt(argc, argv, "f:ascv")) != -1)
|
||||||
switch (o) {
|
{
|
||||||
|
switch (o)
|
||||||
|
{
|
||||||
case 'f':
|
case 'f':
|
||||||
nmseffect_set_foregroundcolor(optarg);
|
nmseffect_set_foregroundcolor(optarg);
|
||||||
break;
|
break;
|
||||||
@ -37,13 +40,18 @@ int main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
printf("nms version " VERSION "\n");
|
printf("nms version " VERSION "\n");
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
case '?':
|
case '?':
|
||||||
if (isprint(optopt))
|
if (isprint(optopt))
|
||||||
fprintf (stderr, "Unknown option '-%c'.\n", optopt);
|
{
|
||||||
|
error_log("Unknown option '-%c'.", optopt);
|
||||||
|
}
|
||||||
else
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user