#include "ConfigCmd.h" #include "spark/config/ConfigQuerier.h" #include "spark/config/config.h" namespace bts::cmds { using bts::config::ConfigQuerier; using std::string; using std::vector; struct ConfigCmd::Args { bool all; bool list_keys; bool verbose; vector keys; vector excluded_keys; }; ConfigCmd::ConfigCmd() : CLI::App("Query Spark configuration", "config"), args_(std::make_unique()) { add_option( "--query", args_->keys, "Keys to query (supports regular expressions)"); add_option( "--exclude", args_->excluded_keys, "Keys to exclude from query (supports regular expressions)"); add_flag("--list-keys", args_->list_keys, "List available keys"); add_flag("--verbose", args_->verbose, "Show verbose output"); callback([&] { ConfigQuerier::run( args_->keys, args_->excluded_keys, args_->all, args_->list_keys, args_->verbose); }); } ConfigCmd::~ConfigCmd() {} } // namespace bts::cmds