#pragma once #include #include #include #include namespace DB { class ICommand; using CommandPtr = std::unique_ptr; namespace po = boost::program_options; using ProgramOptionsDescription = boost::program_options::options_description; using CommandLineOptions = boost::program_options::variables_map; class DisksApp : public Poco::Util::Application, public Loggers { public: DisksApp() = default; void init(std::vector & common_arguments); int main(const std::vector & args) override; protected: static String getDefaultConfigFileName(); void addOptions( ProgramOptionsDescription & options_description, boost::program_options::positional_options_description & positional_options_description); void processOptions(); void printHelpMessage(ProgramOptionsDescription & command_option_description); size_t findCommandPos(std::vector & common_arguments); private: void parseAndCheckOptions( ProgramOptionsDescription & options_description, boost::program_options::positional_options_description & positional_options_description, std::vector & arguments); protected: ContextMutablePtr global_context; SharedContextHolder shared_context; String command_name; std::vector command_arguments; std::unordered_set supported_commands; std::unordered_map command_descriptions; po::variables_map options; }; }