All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header
@ 2015-01-18 16:21 Benno Schulenberg
  2015-01-18 16:21 ` [PATCH 2/2] cfdisk: shorten the help screen to make it fit within 25 lines Benno Schulenberg
  2015-01-26 10:55 ` [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Benno Schulenberg @ 2015-01-18 16:21 UTC (permalink / raw)
  To: util-linux

Asking for the translation of the empty string ("") produces the header
of the PO file corresponding to the current locale, which messes up the
help screen.  So, don't use empty strings in the array of help strings
but (arbitrary) double spaces.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 disk-utils/cfdisk.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 1d4e2d5..b461b21 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -1798,14 +1798,14 @@ static int ui_help(void)
 	size_t i;
 	static const char *help[] = {
 		N_("Help Screen for cfdisk"),
-		"",
+		"  ",
 		N_("This is cfdisk, a curses based disk partitioning program, which"),
 		N_("allows you to create, delete and modify partitions on your hard"),
 		N_("disk drive."),
-		"",
+		"  ",
 		N_("Copyright (C) 2014 Karel Zak <kzak@redhat.com> "),
 		N_("Based on the original cfdisk from Kevin E. Martin & aeb."),
-		"",
+		"  ",
 		N_("Command      Meaning"),
 		N_("-------      -------"),
 		N_("  b          Toggle bootable flag of the current partition"),
@@ -1824,11 +1824,10 @@ static int ui_help(void)
 		N_("Down Arrow   Move cursor to the next partition"),
 		N_("Left Arrow   Move cursor to the previous menu item"),
 		N_("Right Arrow  Move cursor to the next menu item"),
-
-		"",
+		"  ",
 		N_("Note: All of the commands can be entered with either upper or lower"),
 		N_("case letters (except for Writes)."),
-		"",
+		"  ",
 		N_("Use lsblk(8) or partx(8) to see more details about the device.")
 	};
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] cfdisk: shorten the help screen to make it fit within 25 lines
  2015-01-18 16:21 [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Benno Schulenberg
@ 2015-01-18 16:21 ` Benno Schulenberg
  2015-01-26 10:55 ` [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Benno Schulenberg @ 2015-01-18 16:21 UTC (permalink / raw)
  To: util-linux

When the terminal has less than 32 lines, the new cfdisk ignored the
fact that the help-screen text was longer and just skipped printing
the remaining lines.  Instead of introducing a minipager for the help
screen, just condense its text and remove unneeded lines.  Now the
text occupies just 25 lines, which should fit on most terminals.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 disk-utils/cfdisk.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index b461b21..bad8681 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -1797,14 +1797,8 @@ static int ui_help(void)
 {
 	size_t i;
 	static const char *help[] = {
-		N_("Help Screen for cfdisk"),
-		"  ",
-		N_("This is cfdisk, a curses based disk partitioning program, which"),
-		N_("allows you to create, delete and modify partitions on your hard"),
-		N_("disk drive."),
-		"  ",
-		N_("Copyright (C) 2014 Karel Zak <kzak@redhat.com> "),
-		N_("Based on the original cfdisk from Kevin E. Martin & aeb."),
+		N_("This is cfdisk, a curses-based disk partitioning program."),
+		N_("It lets you create, delete, and modify partitions on a block device."),
 		"  ",
 		N_("Command      Meaning"),
 		N_("-------      -------"),
@@ -1813,20 +1807,19 @@ static int ui_help(void)
 		N_("  h          Print this screen"),
 		N_("  n          Create new partition from free space"),
 		N_("  q          Quit program without writing partition table"),
-		N_("  t          Change the partition type"),
 		N_("  s          Fix partitions order (only when in disarray)"),
+		N_("  t          Change the partition type"),
 		N_("  u          Dump disk layout to sfdisk compatible script file"),
-		N_("  W          Write partition table to disk (must enter upper case W)"),
-		N_("             Since this might destroy data on the disk, you must"),
-		N_("             either confirm or deny the write by entering `yes' or"),
-		N_("             `no'"),
+		N_("  W          Write partition table to disk (you must enter uppercase W);"),
+		N_("               since this might destroy data on the disk, you must either"),
+		N_("               confirm or deny the write by entering 'yes' or 'no'"),
 		N_("Up Arrow     Move cursor to the previous partition"),
 		N_("Down Arrow   Move cursor to the next partition"),
 		N_("Left Arrow   Move cursor to the previous menu item"),
 		N_("Right Arrow  Move cursor to the next menu item"),
 		"  ",
 		N_("Note: All of the commands can be entered with either upper or lower"),
-		N_("case letters (except for Writes)."),
+		N_("case letters (except for Write)."),
 		"  ",
 		N_("Use lsblk(8) or partx(8) to see more details about the device.")
 	};
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header
  2015-01-18 16:21 [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Benno Schulenberg
  2015-01-18 16:21 ` [PATCH 2/2] cfdisk: shorten the help screen to make it fit within 25 lines Benno Schulenberg
@ 2015-01-26 10:55 ` Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Karel Zak @ 2015-01-26 10:55 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: util-linux

On Sun, Jan 18, 2015 at 05:21:24PM +0100, Benno Schulenberg wrote:
>  disk-utils/cfdisk.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)

 All 2 patches applied.

    Karel
-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-26 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18 16:21 [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Benno Schulenberg
2015-01-18 16:21 ` [PATCH 2/2] cfdisk: shorten the help screen to make it fit within 25 lines Benno Schulenberg
2015-01-26 10:55 ` [PATCH 1/2] cfdisk: don't mess up the help screen by printing the PO file header Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.