remove some hardcoded "nsxiv", use progname instead

This commit is contained in:
NRK 2022-07-15 11:56:45 +06:00 committed by Gitea
parent fbe186e79d
commit 7e3e6008fe
2 changed files with 4 additions and 4 deletions

2
main.c
View File

@ -158,7 +158,7 @@ void remove_file(int n, bool manual)
if (filecnt == 1) { if (filecnt == 1) {
if (!manual) if (!manual)
fprintf(stderr, "nsxiv: no more files to display, aborting\n"); fprintf(stderr, "%s: no more files to display, aborting\n", progname);
exit(manual ? EXIT_SUCCESS : EXIT_FAILURE); exit(manual ? EXIT_SUCCESS : EXIT_FAILURE);
} }
if (files[n].flags & FF_MARK) if (files[n].flags & FF_MARK)

View File

@ -38,9 +38,9 @@ const opt_t *options;
void print_usage(void) void print_usage(void)
{ {
printf("usage: nsxiv [-abcfhiopqrtvZ0] [-A FRAMERATE] [-e WID] [-G GAMMA] " printf("usage: %s [-abcfhiopqrtvZ0] [-A FRAMERATE] [-e WID] [-G GAMMA] "
"[-g GEOMETRY] [-N NAME] [-n NUM] [-S DELAY] [-s MODE] " "[-g GEOMETRY] [-N NAME] [-n NUM] [-S DELAY] [-s MODE] "
"[-z ZOOM] FILES...\n"); "[-z ZOOM] FILES...\n", progname);
} }
static void title_deprecation_notice(void) static void title_deprecation_notice(void)
@ -58,7 +58,7 @@ static void title_deprecation_notice(void)
static void print_version(void) static void print_version(void)
{ {
puts("nsxiv " VERSION); printf("%s %s\n", progname, VERSION);
} }
void parse_options(int argc, char **argv) void parse_options(int argc, char **argv)