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