From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 08/14] dmesg: make usage() translator friendly
Date: Tue, 22 Jan 2013 23:27:07 +0000 [thread overview]
Message-ID: <1358897233-6676-9-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1358897233-6676-1-git-send-email-kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/dmesg.c | 75 ++++++++++++++++++++++++++-----------------------------
1 file changed, 35 insertions(+), 40 deletions(-)
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index f95db40..14c3e18 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -198,51 +198,46 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
{
size_t i;
- fputs(_("\nUsage:\n"), out);
- fprintf(out,
- _(" %s [options]\n"), program_invocation_short_name);
-
- fputs(_("\nOptions:\n"), out);
- fputs(_(" -C, --clear clear the kernel ring buffer\n"
- " -c, --read-clear read and clear all messages\n"
- " -D, --console-off disable printing messages to console\n"
- " -d, --show-delta show time delta between printed messages\n"
- " -e, --reltime show local time and time delta in readable format\n"
- " -E, --console-on enable printing messages to console\n"
- " -F, --file <file> use the file instead of the kernel log buffer\n"
- " -f, --facility <list> restrict output to defined facilities\n"
- " -h, --help display this help and exit\n"
- " -k, --kernel display kernel messages\n"
- " -L, --color colorize messages\n"
- " -l, --level <list> restrict output to defined levels\n"
- " -n, --console-level <level> set level of messages printed to console\n"
- " -r, --raw print the raw message buffer\n"
- " -S, --syslog force to use syslog(2) rather than /dev/kmsg\n"
- " -s, --buffer-size <size> buffer size to query the kernel ring buffer\n"
- " -T, --ctime show human readable timestamp (could be \n"
- " inaccurate if you have used SUSPEND/RESUME)\n"
- " -t, --notime don't print messages timestamp\n"
- " -u, --userspace display userspace messages\n"
- " -V, --version output version information and exit\n"
- " -w, --follow wait for new messages\n"
- " -x, --decode decode facility and level to readable string\n"), out);
-
+ fputs(USAGE_HEADER, out);
+ fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
+ fputs(USAGE_OPTIONS, out);
+ fputs(_(" -C, --clear clear the kernel ring buffer\n"), out);
+ fputs(_(" -c, --read-clear read and clear all messages\n"), out);
+ fputs(_(" -D, --console-off disable printing messages to console\n"), out);
+ fputs(_(" -d, --show-delta show time delta between printed messages\n"), out);
+ fputs(_(" -e, --reltime show local time and time delta in readable format\n"), out);
+ fputs(_(" -E, --console-on enable printing messages to console\n"), out);
+ fputs(_(" -F, --file <file> use the file instead of the kernel log buffer\n"), out);
+ fputs(_(" -f, --facility <list> restrict output to defined facilities\n"), out);
+ fputs(_(" -k, --kernel display kernel messages\n"), out);
+ fputs(_(" -L, --color colorize messages\n"), out);
+ fputs(_(" -l, --level <list> restrict output to defined levels\n"), out);
+ fputs(_(" -n, --console-level <level> set level of messages printed to console\n"), out);
+ fputs(_(" -r, --raw print the raw message buffer\n"), out);
+ fputs(_(" -S, --syslog force to use syslog(2) rather than /dev/kmsg\n"), out);
+ fputs(_(" -s, --buffer-size <size> buffer size to query the kernel ring buffer\n"), out);
+ fputs(_(" -T, --ctime show human readable timestamp (could be \n"
+ " inaccurate if you have used SUSPEND/RESUME)\n"), out);
+ fputs(_(" -t, --notime don't print messages timestamp\n"), out);
+ fputs(_(" -u, --userspace display userspace messages\n"), out);
+ fputs(_(" -w, --follow wait for new messages\n"), out);
+ fputs(_(" -x, --decode decode facility and level to readable string\n"), out);
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fputs(_("\nSupported log facilities:\n"), out);
- for (i = 0; i < ARRAY_SIZE(level_names); i++) {
+ for (i = 0; i < ARRAY_SIZE(level_names); i++)
fprintf(stderr, " %7s - %s\n",
- facility_names[i].name,
- _(facility_names[i].help));
- }
+ facility_names[i].name,
+ _(facility_names[i].help));
fputs(_("\nSupported log levels (priorities):\n"), out);
- for (i = 0; i < ARRAY_SIZE(level_names); i++) {
+ for (i = 0; i < ARRAY_SIZE(level_names); i++)
fprintf(stderr, " %7s - %s\n",
- level_names[i].name,
- _(level_names[i].help));
- }
-
- fputc('\n', out);
-
+ level_names[i].name,
+ _(level_names[i].help));
+ fputc(USAGE_SEPARATOR, out);
+ fprintf(out, USAGE_MAN_TAIL("dmesg(q)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
--
1.8.1.1
next prev parent reply other threads:[~2013-01-22 23:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 23:26 [PATCH 00/14]: usage() fixes for translators Sami Kerola
2013-01-22 23:27 ` [PATCH 01/14] docs: usage function and gettext Sami Kerola
2013-01-22 23:27 ` [PATCH 02/14] nsenter: make usage() translator friendly Sami Kerola
2013-01-22 23:27 ` [PATCH 03/14] partx: " Sami Kerola
2013-01-22 23:27 ` [PATCH 04/14] su-common: " Sami Kerola
2013-01-22 23:27 ` [PATCH 05/14] findmnt: " Sami Kerola
2013-01-22 23:27 ` [PATCH 06/14] lsblk: " Sami Kerola
2013-01-22 23:27 ` [PATCH 07/14] rename: " Sami Kerola
2013-01-22 23:27 ` Sami Kerola [this message]
2013-01-22 23:27 ` [PATCH 09/14] hwclock: make usage() change " Sami Kerola
2013-01-22 23:27 ` [PATCH 10/14] losetup: make usage() " Sami Kerola
2013-01-22 23:27 ` [PATCH 11/14] umount: " Sami Kerola
2013-01-22 23:27 ` [PATCH 12/14] unshare: " Sami Kerola
2013-01-22 23:27 ` [PATCH 13/14] agetty: " Sami Kerola
2013-01-22 23:27 ` [PATCH 14/14] column: " Sami Kerola
2013-01-25 15:40 ` [PATCH 00/14]: usage() fixes for translators Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358897233-6676-9-git-send-email-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox