ClickHouse/programs/disks/DisksClient.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
C++
Raw Normal View History

2024-05-27 11:44:45 +00:00
#include "DisksClient.h"
#include <Client/ClientBase.h>
#include <Client/ReplxxLineReader.h>
#include <Parsers/parseQuery.h>
#include <Poco/Util/HelpFormatter.h>
#include <Common/Config/ConfigProcessor.h>
#include <Common/EventNotifier.h>
#include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/filesystemHelpers.h>
#include "ICommand.h"
#include <cstring>
#include <memory>
#include <Disks/registerDisks.h>
#include <Formats/registerFormats.h>
#include <Common/TerminalSize.h>
namespace DB
{
std::vector<String> split(const String & text, const String & delimiters)
{
std::vector<String> arguments;
auto prev = text.begin();
auto pos = std::find_if(text.begin(), text.end(), [&](char x) { return delimiters.contains(x); });
while (pos != text.end())
{
if (pos > prev)
{
arguments.push_back({prev, pos});
}
prev = ++pos;
pos = std::find_if(prev, text.end(), [&](char x) { return delimiters.contains(x); });
}
if (pos > prev)
{
arguments.push_back({prev, text.end()});
}
return arguments;
}
}