]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: print welcome message
authorFrancesco Cosoleto <cosoleto@gmail.com>
Tue, 16 Aug 2011 22:19:04 +0000 (00:19 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 30 Aug 2011 08:54:37 +0000 (10:54 +0200)
This adds a welcome message with util-linux version number, information
about fdisk behaviour that doesn't write to disk after a command (unlike
gparted) and a warning about possible data loss.

The message appears just before the first command prompt.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
fdisk/fdisk.c
fdisk/fdisksgilabel.c
fdisk/fdisksunlabel.c

index d3fc200103719dc47baf1b50aac7606a3ce4350f..1c1f49211ff0492f6e46c51e9d99a281d4644de2 100644 (file)
@@ -932,11 +932,7 @@ static void
 create_doslabel(void) {
        unsigned int id = get_random_id();
 
-       fprintf(stderr,
-       _("Building a new DOS disklabel with disk identifier 0x%08x.\n"
-         "Changes will remain in memory only, until you decide to write them.\n"
-         "After that, of course, the previous content won't be recoverable.\n\n"),
-               id);
+       fprintf(stderr, _("Building a new DOS disklabel with disk identifier 0x%08x.\n"), id);
        sun_nolabel();  /* otherwise always recognised as sun */
        sgi_nolabel();  /* otherwise always recognised as sgi */
        disklabel = DOS_LABEL;
@@ -3093,6 +3089,10 @@ main(int argc, char **argv) {
                disklabel = DOS_LABEL;
        }
 
+       fprintf(stderr, _("Welcome to fdisk (%s).\n\n"
+               "Changes will remain in memory only, until you decide to write them.\n"
+               "Be careful before using the write command.\n"), PACKAGE_STRING);
+
        while (1) {
                putchar('\n');
                c = tolower(read_char(_("Command (m for help): ")));
index 35959091658321658fead02d126c06304fc176a7..091902ab0ab800bf06929e5a96976ec0c450587f 100644 (file)
@@ -698,9 +698,7 @@ create_sgilabel(void)
        sec_fac = sector_size / 512;    /* determine the sector factor */
 
        fprintf(stderr,
-               _("Building a new SGI disklabel. Changes will remain in memory only,\n"
-                 "until you decide to write them. After that, of course, the previous\n"
-                 "content will be unrecoverably lost.\n\n"));
+               _("Building a new SGI disklabel.\n"));
 
        other_endian = (BYTE_ORDER == LITTLE_ENDIAN);
 
index 7d3aa09e1e040303181aaa36d5a81ba2e9d9d15e..80408dd10d9caa4a72172a234d4c4f4ff9aa2930 100644 (file)
@@ -189,9 +189,7 @@ void create_sunlabel(void)
        int res;
 
        fprintf(stderr,
-       _("Building a new sun disklabel. Changes will remain in memory only,\n"
-               "until you decide to write them. After that, of course, the previous\n"
-       "content won't be recoverable.\n\n"));
+       _("Building a new Sun disklabel.\n"));
 #if BYTE_ORDER == LITTLE_ENDIAN
        other_endian = 1;
 #else