From e9f7392d317a960fbeb84cab02a352f9f9f34c12 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 9 Oct 2011 02:10:05 +0200 Subject: [PATCH] pwdx: add gettext support Signed-off-by: Sami Kerola --- pwdx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pwdx.c b/pwdx.c index 8edf8fb2..7e6b2511 100644 --- a/pwdx.c +++ b/pwdx.c @@ -20,15 +20,17 @@ #include #include "proc/version.h" +#include "c.h" +#include "nls.h" static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fprintf(out, "\nUsage:\n" - " %s [options] pid...\n", program_invocation_short_name); - fprintf(out, - "\nOptions:\n" - " -V, --version output version information and exit\n" - " -h, --help output help screen and exit\n\n"); + fputs(USAGE_HEADER, out); + fprintf(out, " %s [options] pid...\n", program_invocation_short_name); + fputs(USAGE_OPTIONS, out); + fputs(USAGE_HELP, out); + fputs(USAGE_VERSION, out); + fprintf(out, USAGE_MAN_TAIL("pwdx(1)")); 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) switch (ch) { case 'V': - display_version(); + printf(PROCPS_NG_VERSION); return EXIT_SUCCESS; case 'h': usage(stdout);