[parted-devel] [PATCH 5/7] parted: Allow undocumented commands

Phillip Susi psusi at ubuntu.com
Sun May 25 21:11:31 UTC 2014


Have command_print_summary print nothing if the command summary is NULL.
This allows for a command to be registered, but not documented in the
output of help.
---
 parted/command.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/parted/command.c b/parted/command.c
index c592248..8a324fe 100644
--- a/parted/command.c
+++ b/parted/command.c
@@ -118,6 +118,8 @@ command_get_names (Command** list)
 void
 command_print_summary (Command* cmd)
 {
+        if (cmd->summary == NULL)
+                return;
         fputs ("  ", stdout);
 	str_list_print_wrap (cmd->summary, screen_width(), 2, 8, stdout);
 	putchar ('\n');
-- 
1.9.1




More information about the parted-devel mailing list