pwdx: add gettext support

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-10-09 02:10:05 +02:00
parent d59cf08c9d
commit e9f7392d31

16
pwdx.c
View File

@ -20,15 +20,17 @@
#include <unistd.h> #include <unistd.h>
#include "proc/version.h" #include "proc/version.h"
#include "c.h"
#include "nls.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out) static void __attribute__ ((__noreturn__)) usage(FILE * out)
{ {
fprintf(out, "\nUsage:\n" fputs(USAGE_HEADER, out);
" %s [options] pid...\n", program_invocation_short_name); fprintf(out, " %s [options] pid...\n", program_invocation_short_name);
fprintf(out, fputs(USAGE_OPTIONS, out);
"\nOptions:\n" fputs(USAGE_HELP, out);
" -V, --version output version information and exit\n" fputs(USAGE_VERSION, out);
" -h, --help output help screen and exit\n\n"); fprintf(out, USAGE_MAN_TAIL("pwdx(1)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
} }
@ -49,7 +51,7 @@ int main(int argc, char *argv[])
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1) while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) { switch (ch) {
case 'V': case 'V':
display_version(); printf(PROCPS_NG_VERSION);
return EXIT_SUCCESS; return EXIT_SUCCESS;
case 'h': case 'h':
usage(stdout); usage(stdout);