diff --git a/userspace/falco/app/options.cpp b/userspace/falco/app/options.cpp index 3285a401..7e5bf277 100644 --- a/userspace/falco/app/options.cpp +++ b/userspace/falco/app/options.cpp @@ -26,25 +26,6 @@ limitations under the License. namespace falco { namespace app { -// Most bool member variables do not need to be set explicitly, as -// they are bound to command line options that have default -// values. However, a few options can be ifdef'd out so explicitly -// initialize their linked variables. -options::options() - : event_buffer_format(sinsp_evt::PF_NORMAL), - list_fields(false), - list_plugins(false), - list_syscall_events(false), - markdown(false), - unbuffered_outputs(false), - dry_run(false) -{ -} - -options::~options() -{ -} - bool options::parse(int argc, char **argv, std::string &errstr) { cxxopts::Options opts("falco", "Falco - Cloud Native Runtime Security"); diff --git a/userspace/falco/app/options.h b/userspace/falco/app/options.h index ab4e782c..cbd4ee12 100644 --- a/userspace/falco/app/options.h +++ b/userspace/falco/app/options.h @@ -31,50 +31,50 @@ namespace app { class options { public: - options(); - virtual ~options(); + options() = default; + ~options() = default; options(options&&) = default; options& operator = (options&&) = default; options(const options&) = default; options& operator = (const options&) = default; // Each of these maps directly to a command line option. - bool help; + bool help = false; std::string conf_filename; - bool all_events; - sinsp_evt::param_fmt event_buffer_format; + bool all_events = false; + sinsp_evt::param_fmt event_buffer_format = sinsp_evt::PF_NORMAL; std::vector cri_socket_paths; - bool disable_cri_async; + bool disable_cri_async = false; std::vector disable_sources; std::vector disabled_rule_substrings; std::vector enable_sources; std::string gvisor_generate_config_with_socket; - bool describe_all_rules; + bool describe_all_rules = false; std::string describe_rule; bool print_ignored_events; - bool list_fields; + bool list_fields = false; std::string list_source_fields; - bool list_plugins; + bool list_plugins = false; std::string print_plugin_info; - bool list_syscall_events; - bool markdown; - int duration_to_tot; - bool names_only; + bool list_syscall_events = false; + bool markdown = false; + int duration_to_tot = 0; + bool names_only = false; std::vector cmdline_config_options; std::string print_additional; std::string pidfilename; // Rules list as passed by the user, via cmdline option '-r' std::list rules_filenames; - uint64_t snaplen; - bool print_support; + uint64_t snaplen = 0; + bool print_support = false; std::set disabled_rule_tags; std::set enabled_rule_tags; - bool unbuffered_outputs; + bool unbuffered_outputs = false; std::vector validate_rules_filenames; - bool verbose; - bool print_version_info; - bool print_page_size; - bool dry_run; + bool verbose = false; + bool print_version_info = false; + bool print_page_size = false; + bool dry_run = false; bool parse(int argc, char **argv, std::string &errstr);