From: Markus Teich Date: Thu, 12 Jan 2017 16:28:41 +0000 (+0100) Subject: add basic cmdline checking X-Git-Tag: taler-0.2.1~462 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=220d336ce3bcb6444b090914a7ee72a32c915414;p=oweals%2Fgnunet.git add basic cmdline checking --- diff --git a/src/auction/gnunet-auction-create.c b/src/auction/gnunet-auction-create.c index 13c84f49a..fae9c13ae 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; }