return ret;
}
+/*
+ * Check for the "help" option in the argv. If found, return 1 else return 0.
+ */
+static int check_help_command(int argc, char **argv)
+{
+ int i;
+
+ for (i = 0; i < argc; i++) {
+ if ((strncmp(argv[i], "-h", 2) == 0) ||
+ strncmp(argv[i], "--h", 3) == 0) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/*
* parse_args
*
usage(stderr);
goto error;
case 'v':
- opt_verbose = 1;
+ opt_verbose += 1;
break;
case 'q':
opt_quiet = 1;
}
/* Spawn session daemon if needed */
- if (opt_no_sessiond == 0 && (check_sessiond() < 0)) {
+ if (opt_no_sessiond == 0 && check_help_command(argc, argv) == 0 &&
+ (check_sessiond() < 0)) {
goto error;
}