diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -26,6 +26,7 @@ #include "font.h" #include "i18n.h" #include "image.h" +#include "output.h" #include "text.h" static void @@ -54,6 +55,8 @@ main(int argc, char **argv) struct text *text; struct image *image; + set_program_name(argv[0]); + font = NULL; w = 0; h = 0; @@ -66,8 +69,7 @@ main(int argc, char **argv) } font = font_find(optarg); if (!font) { - fprintf(stderr, _("Font \"%s\" not " - "found\n"), + error(_("Font \"%s\" not found"), optarg); usage(stderr, argv[0]); return 1; @@ -76,10 +78,9 @@ main(int argc, char **argv) case 'w': w = strtol(optarg, &end, 10); if (*optarg == '\0' || *end != '\0' || w <= 0) { - fprintf(stderr, _("Width must be an " - "integer " - "greater than " - "0\n")); + error(_("Width must be an integer " + "greater than 0" + )); usage(stderr, argv[0]); return 1; } @@ -87,10 +88,9 @@ main(int argc, char **argv) case 'h': h = strtol(optarg, &end, 10); if (*optarg == '\0' || *end != '\0' || h <= 0) { - fprintf(stderr, _("Height must be an " - "integer " - "greater than " - "0\n")); + error(_("Height must be an integer " + "greater than 0" + )); usage(stderr, argv[0]); return 1; } @@ -113,8 +113,8 @@ main(int argc, char **argv) if (strcmp(input, "-") != 0) { fp = fopen(input, "r"); if (!fp) { - fprintf(stderr, _("Error: Cannot open \"%s\" for " - "reading\n"), input); + error(_("Error: Cannot open \"%s\" for reading"), + input); return 1; } } else { |