aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/up_cmd.h
blob: c9af16749dbe8095e6763c9da9327f5c2fadcc7e (plain) (blame)
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
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "../zen.h"

#include <filesystem>

namespace zen {

class UpCommand : public ZenCmdBase
{
public:
	UpCommand();
	~UpCommand();

	virtual int				  Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
	virtual cxxopts::Options& Options() override { return m_Options; }

private:
	cxxopts::Options	  m_Options{"up", "Bring up zen service"};
	uint16_t			  m_Port		= 0;
	bool				  m_ShowConsole = false;
	bool				  m_ShowLog		= false;
	std::filesystem::path m_ProgramBaseDir;
};

class AttachCommand : public ZenCmdBase
{
public:
	AttachCommand();
	~AttachCommand();

	virtual int				  Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
	virtual cxxopts::Options& Options() override { return m_Options; }

private:
	cxxopts::Options	  m_Options{"attach", "Add a sponsor process to a running zen service"};
	uint16_t			  m_Port	 = 0;
	int					  m_OwnerPid = 0;
	std::filesystem::path m_DataDir;
};

class DownCommand : public ZenCmdBase
{
public:
	DownCommand();
	~DownCommand();

	virtual int				  Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
	virtual cxxopts::Options& Options() override { return m_Options; }

private:
	cxxopts::Options	  m_Options{"down", "Bring down zen service"};
	uint16_t			  m_Port		   = 0;
	bool				  m_ForceTerminate = false;
	std::filesystem::path m_ProgramBaseDir;
	std::filesystem::path m_DataDir;
};

}  // namespace zen