Using PROGNAME for browser(1) as well

This commit is contained in:
Pierre Pronchery 2013-11-24 04:09:38 +01:00
parent dec1dee9e2
commit 1498febe8d
3 changed files with 14 additions and 5 deletions

View File

@ -45,6 +45,9 @@ static char const _license[] =
#include "common.c"
/* constants */
#ifndef PROGNAME
# define PROGNAME "browser"
#endif
#ifndef PREFIX
# define PREFIX "/usr/local"
#endif
@ -765,7 +768,7 @@ int browser_error(Browser * browser, char const * message, int ret)
static int _browser_error(char const * message, int ret)
{
fprintf(stderr, "%s: %s\n", "browser", message);
fprintf(stderr, "%s: %s\n", PROGNAME, message);
return ret;
}

View File

@ -39,7 +39,9 @@
#define _(string) gettext(string)
/* constants */
#define PROGNAME "browser"
#ifndef PROGNAME
# define PROGNAME "browser"
#endif
#define COMMON_DND
#define COMMON_EXEC
#define COMMON_SYMLINK

View File

@ -26,6 +26,9 @@
#define _(string) gettext(string)
/* constants */
#ifndef PROGNAME
# define PROGNAME "browser"
#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)
{
fputs("browser: ", stderr);
fputs(PROGNAME ": ", stderr);
perror(message);
return ret;
}
@ -57,9 +60,10 @@ static int _error(char const * message, int ret)
static int _usage(void)
{
#if GTK_CHECK_VERSION(2, 6, 0)
fputs(_("Usage: browser [-D|-I|-L|-T] [directory...]\n"), stderr);
fprintf(stderr, _("Usage: %s [-D|-I|-L|-T] [directory...]\n"),
PROGNAME);
#else
fputs(_("Usage: browser [-D] [directory...]\n"), stderr);
fprintf(stderr, _("Usage: %s [-D] [directory...]\n"), PROGNAME);
#endif
return 1;
}