mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-11 19:12:12 +00:00
Merge pull request #23 from draios/config
Command-line options simplification
This commit is contained in:
commit
28b21eb5b3
@ -44,12 +44,7 @@ static void usage()
|
|||||||
"Usage: digwatch [options] rules_filename\n\n"
|
"Usage: digwatch [options] rules_filename\n\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -h, --help Print this page\n"
|
" -h, --help Print this page\n"
|
||||||
" -m <filename>, --main-lua <filename>\n"
|
|
||||||
" Name of lua compiler main file\n"
|
|
||||||
" (default: rules_loader.lua)\n"
|
|
||||||
" -N Don't convert port numbers to names.\n"
|
|
||||||
" -o Output type (options are 'stdout', 'syslog', default is 'stdout')\n"
|
" -o Output type (options are 'stdout', 'syslog', default is 'stdout')\n"
|
||||||
" process or into a script.\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -190,7 +185,7 @@ int digwatch_init(int argc, char **argv)
|
|||||||
// Parse the args
|
// Parse the args
|
||||||
//
|
//
|
||||||
while((op = getopt_long(argc, argv,
|
while((op = getopt_long(argc, argv,
|
||||||
"hNo:",
|
"ho:",
|
||||||
long_options, &long_index)) != -1)
|
long_options, &long_index)) != -1)
|
||||||
{
|
{
|
||||||
switch(op)
|
switch(op)
|
||||||
@ -198,9 +193,6 @@ int digwatch_init(int argc, char **argv)
|
|||||||
case 'h':
|
case 'h':
|
||||||
usage();
|
usage();
|
||||||
goto exit;
|
goto exit;
|
||||||
case 'N':
|
|
||||||
inspector->set_hostname_and_port_resolution_mode(false);
|
|
||||||
break;
|
|
||||||
case 'o':
|
case 'o':
|
||||||
valid = std::find(valid_output_names.begin(), valid_output_names.end(), optarg) != valid_output_names.end();
|
valid = std::find(valid_output_names.begin(), valid_output_names.end(), optarg) != valid_output_names.end();
|
||||||
if (!valid)
|
if (!valid)
|
||||||
@ -294,6 +286,8 @@ int digwatch_init(int argc, char **argv)
|
|||||||
rules->load_rules(rules_file);
|
rules->load_rules(rules_file);
|
||||||
inspector->set_filter(rules->get_filter());
|
inspector->set_filter(rules->get_filter());
|
||||||
|
|
||||||
|
inspector->set_hostname_and_port_resolution_mode(false);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
inspector->open("");
|
inspector->open("");
|
||||||
|
Loading…
Reference in New Issue
Block a user