[Listener] Add -h option
This commit is contained in:
parent
5eb11af87f
commit
7aa0b65f72
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Arguments & program configuration */
|
/* Arguments & program configuration */
|
||||||
#define OPTIONS "d:f:kl:m:p:qr:vw:" // getopt string
|
#define OPTIONS "d:f:hkl:m:p:qr:vw:" // getopt string
|
||||||
#define DEFAULT_CONFIG_FILE "/usr/local/etc/owlps/owlps-listener.conf"
|
#define DEFAULT_CONFIG_FILE "/usr/local/etc/owlps/owlps-listener.conf"
|
||||||
enum {MODE_ACTIVE = 'a', MODE_PASSIVE = 'p', MODE_MIXED = 'm'} ;
|
enum {MODE_ACTIVE = 'a', MODE_PASSIVE = 'p', MODE_MIXED = 'm'} ;
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,9 @@ int main(int argc, char *argv[])
|
||||||
break ;
|
break ;
|
||||||
case 'f' : // Config file
|
case 'f' : // Config file
|
||||||
break ; // (already parsed)
|
break ; // (already parsed)
|
||||||
|
case 'h' :
|
||||||
|
print_usage(argv[0]) ;
|
||||||
|
exit(0) ;
|
||||||
case 'k' :
|
case 'k' :
|
||||||
#ifdef USE_PTHREAD
|
#ifdef USE_PTHREAD
|
||||||
SET_KEEP_MONITOR() ;
|
SET_KEEP_MONITOR() ;
|
||||||
|
@ -692,6 +695,7 @@ void print_usage(char *prog)
|
||||||
" [-w wifi_iface] [-k] [-v | -q]\n"
|
" [-w wifi_iface] [-k] [-v | -q]\n"
|
||||||
|
|
||||||
"Main options:\n"
|
"Main options:\n"
|
||||||
|
"\t-h\t\tPrint this help.\n"
|
||||||
"\t-f config_file\tUse 'config_file' instead of the default"
|
"\t-f config_file\tUse 'config_file' instead of the default"
|
||||||
" configuration file (%s). Available only if program was"
|
" configuration file (%s). Available only if program was"
|
||||||
" compiled with libconfuse.\n"
|
" compiled with libconfuse.\n"
|
||||||
|
|
Loading…
Reference in New Issue