mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
70d1adfe4b
* save format string for NetException * format exceptions * format exceptions 2 * format exceptions 3 * format exceptions 4 * format exceptions 5 * format exceptions 6 * fix * format exceptions 7 * format exceptions 8 * Update MergeTreeIndexGin.cpp * Update AggregateFunctionMap.cpp * Update AggregateFunctionMap.cpp * fix
48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
#include "ICommand.h"
|
|
#include <Interpreters/Context.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int BAD_ARGUMENTS;
|
|
}
|
|
|
|
class CommandListDisks final : public ICommand
|
|
{
|
|
public:
|
|
CommandListDisks()
|
|
{
|
|
command_name = "list-disks";
|
|
description = "List disks names";
|
|
usage = "list-disks [OPTION]";
|
|
}
|
|
|
|
void processOptions(
|
|
Poco::Util::LayeredConfiguration &,
|
|
po::variables_map &) const override
|
|
{}
|
|
|
|
void execute(
|
|
const std::vector<String> & command_arguments,
|
|
DB::ContextMutablePtr & global_context,
|
|
Poco::Util::LayeredConfiguration &) override
|
|
{
|
|
if (!command_arguments.empty())
|
|
{
|
|
printHelpMessage();
|
|
throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Bad Arguments");
|
|
}
|
|
|
|
for (const auto & [disk_name, _] : global_context->getDisksMap())
|
|
std::cout << disk_name << '\n';
|
|
}
|
|
};
|
|
}
|
|
|
|
std::unique_ptr <DB::ICommand> makeCommandListDisks()
|
|
{
|
|
return std::make_unique<DB::CommandListDisks>();
|
|
}
|