Use PROGNAME

This commit is contained in:
Pierre Pronchery 2015-11-22 23:57:24 +01:00
parent 5fffc05e23
commit cf80726ef5

View File

@ -26,6 +26,9 @@
#define _(string) gettext(string) #define _(string) gettext(string)
/* constants */ /* constants */
#ifndef PROGNAME
# define PROGNAME "clock"
#endif
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
@ -47,7 +50,7 @@ static int _usage(void);
/* error */ /* error */
static int _error(char const * message, int ret) static int _error(char const * message, int ret)
{ {
fprintf(stderr, "clock: %s\n", message); fprintf(stderr, "%s: %s\n", PROGNAME, message);
return ret; return ret;
} }
@ -55,7 +58,7 @@ static int _error(char const * message, int ret)
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fputs(_("Usage: clock\n"), stderr); fprintf(stderr, _("Usage: %s\n"), PROGNAME);
return 1; return 1;
} }