textual: improve the wording of some error and usage messages

[kzak@redhat.com: - cleanup lscpu(1) usage text
                  - use <disk> rather than <device> in partx(8)
                    usage text]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Benno Schulenberg 2011-01-31 22:35:44 +01:00 committed by Karel Zak
parent e22d8b9519
commit e8ab5ce3d0
6 changed files with 18 additions and 16 deletions

View File

@ -87,9 +87,9 @@ static boolean get_shell_list (char *shell);
static void __attribute__((__noreturn__)) usage (FILE *fp)
{
fprintf (fp,
_("Usage: %s [ -s shell ] [ --list-shells ] "
"[ --help ] [ --version ]\n"
" [ username ]\n"), whoami);
_("Usage: %1$s [-s shell] [username]\n"
" or: %1$s (--list-shells | --help | --version)\n"),
whoami);
exit(fp == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}

View File

@ -171,7 +171,8 @@ ttymsg(struct iovec *iov, int iovcnt, char *line, int tmout) {
if (forked)
_exit(1);
if (strlen(strerror(errno)) > 1000)
(void) sprintf(errbuf, _("%s: BAD ERROR"), device);
(void) sprintf(errbuf, _("%s: BAD ERROR, message is "
"far too long"), device);
else {
errsv = errno;
(void) sprintf(errbuf, "%s: %s", device,

View File

@ -383,7 +383,7 @@ static struct libmnt_table *parse_tabfile(const char *path)
if (rc) {
mnt_free_table(tb);
warn(_("can't read: %s"), path);
warn(_("can't read %s"), path);
return NULL;
}
return tb;

View File

@ -593,7 +593,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
fprintf(out, _(
"\nUsage:\n"
" %s [-a|-d|-s] [--nr <N:M> | <device>] <wholedisk>\n"),
" %s [-a|-d|-s] [--nr <N:M> | <partition>] <disk>\n"),
program_invocation_short_name);
fprintf(out, _(
@ -607,8 +607,8 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
" -g, --noheadings don't print headings for --show\n"
" -r, --raw use raw format output\n"
" -t, --type <TYPE> specify the partition type (dos, bsd, solaris, etc.)\n"
" -n, --nr <M:N> specify the range of partitions (--nr 2:4)\n"
" -o, --output <LIST> output column\n"
" -n, --nr <M:N> specify the range of partitions (e.g. --nr 2:4)\n"
" -o, --output <LIST> define which output columns to use\n"
" -h, --help print this help\n\n"));
fprintf(out, _("\nAvailable columns (for --show):\n"));

View File

@ -305,7 +305,7 @@ int main(int argc, char **argv)
case 'L':
case 'U':
if (source)
errx(EX_USAGE, _("only one <source> could be specified"));
errx(EX_USAGE, _("only one <source> may be specified"));
if (asprintf(&srcbuf, "%s=\"%s\"",
c == 'L' ? "LABEL" : "UUID", optarg) <= 0)
err(EX_SYSERR, _("failed to allocate source buffer"));

View File

@ -915,14 +915,15 @@ print_readable(struct lscpu_desc *desc, int hex)
static void __attribute__((__noreturn__)) usage(FILE *out)
{
fprintf(out, _("Usage: %s [option]\n"),
program_invocation_short_name);
fprintf(out, _(
"\nUsage:\n"
" %s [options]\n"), program_invocation_short_name);
fprintf(out,_("CPU architecture information helper\n\n"
" -h, --help usage information\n"
" -p, --parse print out in parsable instead of printable format.\n"
" -s, --sysroot use the directory as a new system root.\n"
" -x, --hex print haxadecimal masks rather than lists of CPU(s)\n"));
puts(_( "\nOptions:\n"
" -h, --help print this help\n"
" -p, --parse print out a parsable instead of a readable format\n"
" -s, --sysroot DIR use directory DIR as system root\n"
" -x, --hex print hexadecimal masks rather than lists of CPUs\n"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}