aboutsummaryrefslogtreecommitdiff
path: root/src/auction
diff options
context:
space:
mode:
authorMarkus Teich <teichm@fs.tum.de>2017-01-12 17:28:41 +0100
committerMarkus Teich <teichm@fs.tum.de>2017-01-12 17:28:41 +0100
commit220d336ce3bcb6444b090914a7ee72a32c915414 (patch)
treeb75f29c7270e067a38ef16d2d94beddcb18791ac /src/auction
parent0eb8cdd10f29874f572e215cf91ff42c2a8f9c03 (diff)
add basic cmdline checking
Diffstat (limited to 'src/auction')
-rw-r--r--src/auction/gnunet-auction-create.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/auction/gnunet-auction-create.c b/src/auction/gnunet-auction-create.c
index 13c84f49a6..fae9c13aef 100644
--- a/src/auction/gnunet-auction-create.c
+++ b/src/auction/gnunet-auction-create.c
@@ -55,7 +55,35 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- /* main code here */
+ /* cmdline parsing */
+ if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dstart.rel_value_us)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "required argument --regtime missing or invalid (zero)\n");
+ goto fail;
+ }
+ if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dround.rel_value_us)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "required argument --roundtime missing or invalid (zero)\n");
+ goto fail;
+ }
+ if (!fndesc)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "required argument --description missing\n");
+ goto fail;
+ }
+ if (!fnprices)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "required argument --pricemap missing\n");
+ goto fail;
+ }
+
+fail:
+ ret = 1;
+ return;
}