[gupnp-tools/wip/cleanup: 1/2] upload: Use help text from option context



commit 66e158ba46648bfaa0398d54bb1b74b2d3beb037
Author: Jens Georg <mail jensge org>
Date:   Sat Nov 28 12:18:06 2015 +0100

    upload: Use help text from option context
    
    Make wrong arguments help match output of --help
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/upload/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/upload/main.c b/src/upload/main.c
index 11cecb5..0f648ce 100644
--- a/src/upload/main.c
+++ b/src/upload/main.c
@@ -146,7 +146,11 @@ main (gint   argc,
         }
 
         if (argc < 3) {
-                g_print ("Usage: %s UDN FILE_PATH...\n", argv[0]);
+                char *help = NULL;
+
+                help = g_option_context_get_help (context, TRUE, NULL);
+                g_print ("%s\n", help);
+                g_free (help);
 
                 return -4;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]