From 8152fa571e64fb6f46231a4071312fd7d7bac4b9 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 9 Oct 2011 12:25:30 +0200 Subject: [PATCH] uptime: add gettext support Signed-off-by: Sami Kerola --- uptime.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/uptime.c b/uptime.c index b0b2b2f5..51c4c557 100644 --- a/uptime.c +++ b/uptime.c @@ -2,19 +2,20 @@ #include #include #include + +#include "c.h" +#include "nls.h" #include "proc/whattime.h" #include "proc/version.h" -static void __attribute__ ((__noreturn__)) - usage(FILE * out) +static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fprintf(out, - "\nUsage: %s [options]\n" - "\nOptions:\n", program_invocation_short_name); - fprintf(out, - " -h, --help display this help text\n" - " -V, --version display version information and exit\n"); - fprintf(out, "\nFor more information see uptime(1).\n"); + fputs(USAGE_HEADER, out); + fprintf(out, _(" %s [options]\n"), program_invocation_short_name); + fputs(USAGE_OPTIONS, out); + fputs(USAGE_HELP, out); + fputs(USAGE_VERSION, out); + fprintf(out, USAGE_MAN_TAIL("uptime(1)")); exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); } @@ -34,7 +35,7 @@ int main(int argc, char **argv) case 'h': usage(stdout); case 'V': - display_version(); + printf(PROCPS_NG_VERSION); return EXIT_SUCCESS; default: usage(stderr);