From 7489bc210520c027e95f0ee8c8df8d0805f50f67 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 1 Dec 2016 13:41:15 +0100 Subject: Fix arg parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cg-rainbow.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/cg-rainbow.c') diff --git a/src/cg-rainbow.c b/src/cg-rainbow.c index 5f2a117..8aaa2cb 100644 --- a/src/cg-rainbow.c +++ b/src/cg-rainbow.c @@ -137,24 +137,14 @@ static int parse_double(double* restrict out, const char* restrict str) * This function is called after the last * call to `handle_opt` * - * @param argc The number of unparsed arguments - * @param argv `NULL` terminated list of unparsed arguments - * @param method The argument associated with the "-M" option - * @param site The argument associated with the "-S" option - * @param crtcs_ The arguments associated with the "-c" options, `NULL`-terminated - * @param prio The argument associated with the "-p" option - * @param rule The argument associated with the "-R" option - * @return Zero on success, -1 on error + * @param argc The number of unparsed arguments + * @param argv `NULL` terminated list of unparsed arguments + * @param prio The argument associated with the "-p" option + * @return Zero on success, -1 on error */ -int handle_args(int argc, char* argv[], char* method, char* site, - char** crtcs_, char* prio, char* rule) +int handle_args(int argc, char* argv[], char* prio) { int q = (lflag || sflag); - q += (method != NULL) && !strcmp(method, "?"); - q += (prio != NULL) && !strcmp(prio, "?"); - q += (rule != NULL) && (!strcmp(rule, "?") || !strcmp(rule, "??")); - for (; *crtcs_; crtcs_++) - q += !strcmp(*crtcs_, "?"); if ((q > 1) || argc) usage(); if (sflag != NULL) @@ -169,8 +159,8 @@ int handle_args(int argc, char* argv[], char* method, char* site, usage(); } return 0; - (void) site; (void) argv; + (void) prio; } -- cgit v1.2.3-70-g09d2