[virt-tools-list] [PATCH virt-viewer 2/2] Set help output summary correctly

Jonathon Jongsma jjongsma at redhat.com
Tue Jul 1 20:15:33 UTC 2014


Use g_option_context_set_summary() to provide a brief description of the
executable instead of tacking the summary onto the end of the
commandline.
---
 src/remote-viewer-main.c | 3 ++-
 src/virt-viewer-main.c   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c
index a84a732..e65cfd9 100644
--- a/src/remote-viewer-main.c
+++ b/src/remote-viewer-main.c
@@ -111,7 +111,8 @@ main(int argc, char **argv)
     virt_viewer_util_init(_("Remote Viewer"));
 
     /* Setup command line options */
-    context = g_option_context_new (_("- Remote viewer client"));
+    context = g_option_context_new (NULL);
+    g_option_context_set_summary(context, _("Remote viewer client"));
     g_option_context_add_main_entries (context, virt_viewer_app_get_options(), NULL);
     g_option_context_add_main_entries (context, options, NULL);
     g_option_context_add_group (context, gtk_get_option_group (TRUE));
diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
index 1f3f112..f6358f0 100644
--- a/src/virt-viewer-main.c
+++ b/src/virt-viewer-main.c
@@ -81,7 +81,8 @@ int main(int argc, char **argv)
     g_free(base_name);
 
     /* Setup command line options */
-    context = g_option_context_new (_("- Virtual machine graphical console"));
+    context = g_option_context_new (NULL);
+    g_option_context_set_summary (context, _("Virtual machine graphical console"));
     g_option_context_add_main_entries (context, options, NULL);
     g_option_context_add_main_entries (context, virt_viewer_app_get_options(), NULL);
     g_option_context_add_group (context, gtk_get_option_group (TRUE));
-- 
1.9.3




More information about the virt-tools-list mailing list