mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-26 14:52:20 +00:00
chore: improve --list output using is_source_valid
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
This commit is contained in:
parent
2ee0645f25
commit
cef2c2d5c1
@ -466,9 +466,9 @@ static void check_for_ignored_events(sinsp &inspector, falco_engine &engine)
|
|||||||
static void list_source_fields(falco_engine *engine, bool verbose, bool names_only, std::string &source)
|
static void list_source_fields(falco_engine *engine, bool verbose, bool names_only, std::string &source)
|
||||||
{
|
{
|
||||||
if(source.size() > 0 &&
|
if(source.size() > 0 &&
|
||||||
!(source == syscall_source || source == k8s_audit_source))
|
!engine->is_source_valid(source))
|
||||||
{
|
{
|
||||||
throw std::invalid_argument("Value for --list must be \"syscall\" or \"k8s_audit\"");
|
throw std::invalid_argument("Value for --list must be a valid source type");
|
||||||
}
|
}
|
||||||
engine->list_fields(source, verbose, names_only);
|
engine->list_fields(source, verbose, names_only);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user