#include #include #include #include "DisksApp.h" #include "ICommand.h" namespace DB { class CommandSwitchDisk final : public ICommand { public: explicit CommandSwitchDisk() : ICommand() { command_name = "switch-disk"; description = "Switch disk (makes sense only in interactive mode)"; options_description.add_options()("disk", po::value(), "the disk to switch to (mandatory, positional)")( "path", po::value(), "the path to switch on the disk"); positional_options_description.add("disk", 1); } void executeImpl(const CommandLineOptions & options, DisksClient & client) override { String disk = getValueFromCommandLineOptions(options, "disk"); std::optional path = getValueFromCommandLineOptionsWithOptional(options, "path"); client.switchToDisk(disk, path); } }; CommandPtr makeCommandSwitchDisk() { return std::make_shared(); } }