forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisksApp.h
66 lines (48 loc) · 1.67 KB
/
DisksApp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include "CommandCopy.cpp"
#include "CommandLink.cpp"
#include "CommandList.cpp"
#include "CommandListDisks.cpp"
#include "CommandMkDir.cpp"
#include "CommandMove.cpp"
#include "CommandRead.cpp"
#include "CommandRemove.cpp"
#include "CommandWrite.cpp"
#include <Loggers/Loggers.h>
#include <Common/ProgressIndication.h>
#include <Common/StatusFile.h>
#include <Common/InterruptListener.h>
#include <Core/Settings.h>
#include <Interpreters/Context.h>
namespace DB
{
using CommandPtr = std::unique_ptr<ICommand>;
class DisksApp : public Poco::Util::Application, public Loggers
{
public:
DisksApp() = default;
void init(std::vector<String> & common_arguments);
int main(const std::vector<String> & 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<String> & common_arguments);
private:
void parseAndCheckOptions(
ProgramOptionsDescription & options_description,
boost::program_options::positional_options_description & positional_options_description,
std::vector<String> & arguments);
protected:
ContextMutablePtr global_context;
SharedContextHolder shared_context;
String command_name;
std::vector<String> command_arguments;
std::unordered_set<String> supported_commands;
std::unordered_map<String, CommandPtr> command_descriptions;
po::variables_map options;
};
}