aboutsummaryrefslogtreecommitdiffstats
path: root/src/cg-sleepmode.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-12-01 13:41:15 +0100
committerMattias Andrée <maandree@kth.se>2016-12-01 13:41:15 +0100
commit7489bc210520c027e95f0ee8c8df8d0805f50f67 (patch)
tree01486d2494e5b91d4dbaa75586b6d6688a6e837a /src/cg-sleepmode.c
parentAdd cg-tools.7 (diff)
downloadcg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.gz
cg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.bz2
cg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.xz
Fix arg parsing
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/cg-sleepmode.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/cg-sleepmode.c b/src/cg-sleepmode.c
index 757b7ef..42fea0d 100644
--- a/src/cg-sleepmode.c
+++ b/src/cg-sleepmode.c
@@ -188,24 +188,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 = (rflag || gflag || bflag || argc);
- 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 > 3))
usage();
if (rflag != NULL)
@@ -233,7 +223,7 @@ int handle_args(int argc, char* argv[], char* method, char* site,
if (blue_target >= 1)
blue_time = 0;
return 0;
- (void) site;
+ (void) prio;
}