summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2015-11-28 12:26:08 +0100
committerJens Georg <mail@jensge.org>2015-11-28 12:37:10 +0100
commit2d348daf3c4e04dbb8400e4dad6a8e7a68d5bef0 (patch)
treec34b8c2cac2d06a90825b78b43dd9a2288a4438d
parent66e158ba46648bfaa0398d54bb1b74b2d3beb037 (diff)
downloadgupnp-tools-wip/cleanup.tar.gz
upload: Make UDN a parameterwip/cleanup
-rw-r--r--src/upload/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/upload/main.c b/src/upload/main.c
index 0f648ce..68af215 100644
--- a/src/upload/main.c
+++ b/src/upload/main.c
@@ -34,7 +34,7 @@ static GUPnPContext *upnp_context;
static GUPnPServiceProxy *cds_proxy;
static GList *files = NULL;
-static char *udn;
+static char *udn = NULL;
static char *interface = NULL;
static const char *title = NULL;
@@ -55,6 +55,9 @@ static GOptionEntry entries[] =
{ "interface", 'e', 0,
G_OPTION_ARG_STRING, &interface,
"Network interface to search MediaServer on", "INTERFACE" },
+ { "udn", 'u', 0,
+ G_OPTION_ARG_STRING, &udn,
+ "UDN of the device to upload to", "UDN" },
{ NULL }
};
@@ -137,7 +140,7 @@ main (gint argc,
g_type_init ();
#endif
- context = g_option_context_new ("- Upload file to UPnP MediaServer");
+ context = g_option_context_new ("- Upload files to UPnP MediaServer");
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (!g_option_context_parse (context, &argc, &argv, &error))
{
@@ -155,10 +158,8 @@ main (gint argc,
return -4;
}
- udn = argv[1];
-
/* Get the list of files to upload */
- for (i = 2; i < argc; i++) {
+ for (i = 1; i < argc; i++) {
if (!g_file_test (argv[i],
G_FILE_TEST_EXISTS |
G_FILE_TEST_IS_REGULAR)) {