usage(1, argv[0]);
}
}
- if (optind + 1 != argc)
- usage(1, argv[0]);
+ if (optind + 1 != argc) {
+ fprintf(stderr, "Need config file. See pgbouncer -h for usage.\n");
+ exit(1);
+ }
cf_config_file = argv[optind];
init_objects();
static const char *usage_str =
"Usage: %s [OPTION]... config.ini\n"
+" -q No console messages\n"
" -v Increase verbosity\n"
-" -u <username> Assume identity of <username>\n"
" -V Show version\n"
" -h Show this help screen and exit\n"
" <windows service registration>\n"
/* check if regular arguments are in allowed list */
for (i = 1; i < argc; i++) {
- char *p = argv[0];
+ char *p = argv[i];
if (p[0] != '-')
continue;
for (j = 1; p[j]; j++) {
- if (!strchr("avhV", p[j]))
+ if (!strchr("qvhV", p[j]))
usage(1, argv[0]);
+ if (p[j] == 'h')
+ usage(0, argv[0]);
}
}