[gupnp-tools] upload: Use help text from option context



commit 7fc8de342765c80345939551a5709ef17f4ef9b6
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]