aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-12-04 13:09:38 +0100
committerChristian Grothoff <christian@grothoff.org>2018-12-04 13:09:38 +0100
commitc99c00f33921990533b80f26baeea4030b873c80 (patch)
tree7d4ea3a23e7326967277d90ff1a9f25b147e1969 /src/namestore/gnunet-namestore.c
parent86a4cfa3852275ab2a286ffd112651c3ae609eea (diff)
downloadgnunet-c99c00f33921990533b80f26baeea4030b873c80.tar.gz
gnunet-c99c00f33921990533b80f26baeea4030b873c80.zip
complain better if args are wrong
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r--src/namestore/gnunet-namestore.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 8386a696d..90fe79779 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1334,6 +1334,10 @@ run (void *cls,
1334 (void) cls; 1334 (void) cls;
1335 (void) args; 1335 (void) args;
1336 (void) cfgfile; 1336 (void) cfgfile;
1337 if (NULL != args[0])
1338 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1339 _("Superfluous command line arguments (starting with `%s') ignored\n"),
1340 args[0]);
1337 if ( (NULL != args[0]) && 1341 if ( (NULL != args[0]) &&
1338 (NULL == uri) ) 1342 (NULL == uri) )
1339 uri = GNUNET_strdup (args[0]); 1343 uri = GNUNET_strdup (args[0]);
@@ -1395,7 +1399,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1395 tok = strtok (cp, " "); 1399 tok = strtok (cp, " ");
1396 if (NULL == tok) 1400 if (NULL == tok)
1397 { 1401 {
1398 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1402 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1399 _("Empty record line argument is not allowed.\n")); 1403 _("Empty record line argument is not allowed.\n"));
1400 GNUNET_free (cp); 1404 GNUNET_free (cp);
1401 return GNUNET_SYSERR; 1405 return GNUNET_SYSERR;
@@ -1405,7 +1409,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1405 &etime_is_rel, 1409 &etime_is_rel,
1406 &record.expiration_time)) 1410 &record.expiration_time))
1407 { 1411 {
1408 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1412 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1409 _("Invalid expiration time `%s'\n"), 1413 _("Invalid expiration time `%s'\n"),
1410 tok); 1414 tok);
1411 GNUNET_free (cp); 1415 GNUNET_free (cp);
@@ -1423,7 +1427,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1423 record.record_type = GNUNET_GNSRECORD_typename_to_number (tok); 1427 record.record_type = GNUNET_GNSRECORD_typename_to_number (tok);
1424 if (UINT32_MAX == record.record_type) 1428 if (UINT32_MAX == record.record_type)
1425 { 1429 {
1426 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1430 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1427 _("Unknown record type `%s'\n"), 1431 _("Unknown record type `%s'\n"),
1428 tok); 1432 tok);
1429 GNUNET_free (cp); 1433 GNUNET_free (cp);
@@ -1432,7 +1436,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1432 tok = strtok (NULL, " "); 1436 tok = strtok (NULL, " ");
1433 if (NULL == tok) 1437 if (NULL == tok)
1434 { 1438 {
1435 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1439 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1436 _("Missing entries in record line `%s'.\n"), 1440 _("Missing entries in record line `%s'.\n"),
1437 value); 1441 value);
1438 GNUNET_free (cp); 1442 GNUNET_free (cp);
@@ -1449,7 +1453,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1449 tok = strchr (&value[tok - cp], (unsigned char) ' '); 1453 tok = strchr (&value[tok - cp], (unsigned char) ' ');
1450 if (NULL == tok) 1454 if (NULL == tok)
1451 { 1455 {
1452 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1456 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1453 _("Missing entries in record line `%s'.\n"), 1457 _("Missing entries in record line `%s'.\n"),
1454 value); 1458 value);
1455 GNUNET_free (cp); 1459 GNUNET_free (cp);
@@ -1463,7 +1467,7 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1463 &raw_data, 1467 &raw_data,
1464 &record.data_size)) 1468 &record.data_size))
1465 { 1469 {
1466 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 1470 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1467 _("Invalid record data for type %s: `%s'.\n"), 1471 _("Invalid record data for type %s: `%s'.\n"),
1468 GNUNET_GNSRECORD_number_to_typename (record.record_type), 1472 GNUNET_GNSRECORD_number_to_typename (record.record_type),
1469 tok); 1473 tok);