I press 'p' then <enter> after everything I do in disklabel.

'P' automatically prints out the equivalent of 'p' after each command and saves 
on finger wear and tear.

like/dislike?

-mark

Index: editor.c
===================================================================
RCS file: /cvs/src/sbin/disklabel/editor.c,v
retrieving revision 1.231
diff -u -p -r1.231 editor.c
--- editor.c    4 Apr 2010 14:12:12 -0000       1.231
+++ editor.c    6 Apr 2010 06:06:14 -0000
@@ -150,6 +150,7 @@ static u_int64_t starting_sector;
static u_int64_t ending_sector;
static int expert;
static int overlap;
+static int print_mode = 0;

/*
* Simple partition editor.
@@ -164,7 +165,7 @@ editor(struct disklabel *lp, int f)
        char buf[BUFSIZ], *cmd, *arg;
        char **omountpoints = NULL;
        char **origmountpoints = NULL, **tmpmountpoints = NULL;
-       int i, error = 0;
+       int i, error = 0, print_info;

        /* Alloc and init mount point info */
        if (!(omountpoints = calloc(MAXPARTITIONS, sizeof(char *))) ||
@@ -305,8 +306,12 @@ editor(struct disklabel *lp, int f)
                        editor_name(&label, arg);
                        break;

+               case 'P':
+                       print_mode = !print_mode;
+                       break;
+
                case 'p':
-                       display_edit(&label, arg ? *arg : 0, 
editor_countfree(&label));
+                       print_info = 1;
                        break;

                case 'l':
@@ -475,6 +480,14 @@ editor(struct disklabel *lp, int f)
                        break;
                }

+               if (print_info || print_mode) {
+                       if (print_mode)
+                               printf("--------------------------" \
+                                   "----------------------\n");
+                       display_edit(&label, arg ? *arg : 0, 
editor_countfree(&label));
+                       print_info = 0;
+               }
+
                /*
                 * If no changes were made to label or mountpoints, then
                 * restore undo info.

Reply via email to