]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
textual: improve the wording of some error and usage messages
authorBenno Schulenberg <bensberg@justemail.net>
Mon, 31 Jan 2011 21:35:44 +0000 (22:35 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Feb 2011 14:46:38 +0000 (15:46 +0100)
[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>
login-utils/chsh.c
login-utils/ttymsg.c
misc-utils/findmnt.c
partx/partx.c
shlibs/mount/samples/mount.c
sys-utils/lscpu.c

index fe610726f93678ee84edd078dab984103d738717..4795bdd5848147aa81042e9ed6ac2b3f69ba48e6 100644 (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);
 }
index 92282c127e359dd497fb9696335b951c2099c138..a4df59e6ce6bd217d7b6ba91913b8c82ce7f699a 100644 (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,
index 19a15fb583b58104b3558259c9154eb9b19ae3e6..e87c70aa3cd9873f5bd0aedb5b538f417532961b 100644 (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;
index 84cb1a17f3c20f24d43f3528316df0e429449e72..ae2648526718bcf9bcf7327722816960705612ad 100644 (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"));
index 38960f8dc6c18424ebb41b9d94098e3181a56fa4..ed3c99a9bbc85d0354e6ab66fa55dd5325b481bd 100644 (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"));
index 373fee14a59b87d733949bbbd597b13358718258..0efc5217c62ce338b3d25663d4cb4a75835604a8 100644 (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,_("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"));
+       fprintf(out, _(
+               "\nUsage:\n"
+               " %s [options]\n"), program_invocation_short_name);
+
+       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);
 }