textual: standardize the reporting of program name plus package version

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
This commit is contained in:
Benno Schulenberg 2013-01-23 13:48:50 +01:00 committed by Karel Zak
parent 4ec32f6a89
commit 0c6625a15d
3 changed files with 3 additions and 5 deletions

View File

@ -213,7 +213,7 @@ static void
die(const char *fmt, ...) { die(const char *fmt, ...) {
va_list ap; va_list ap;
fprintf(stderr, "%s: ", program_invocation_short_name); fprintf(stderr, UTIL_LINUX_VERSION);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);

View File

@ -206,8 +206,7 @@ int main(int argc, char *argv[])
_("invalid exit code")); _("invalid exit code"));
break; break;
case 'V': case 'V':
printf(_("%s from %s\n"), printf(UTIL_LINUX_VERSION);
program_invocation_short_name, PACKAGE_STRING);
exit(EX_OK); exit(EX_OK);
default: default:
/* optopt will be set if this was an unrecognized /* optopt will be set if this was an unrecognized

View File

@ -568,8 +568,7 @@ void argscan(char *s)
case '\t': case '\t':
break; break;
case 'V': case 'V':
printf(_("%s from %s\n"), printf(UTIL_LINUX_VERSION);
program_invocation_short_name, PACKAGE_STRING);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
break; break;
default: default: