-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathOdbDesignArgs.cpp
More file actions
78 lines (66 loc) · 2.44 KB
/
Copy pathOdbDesignArgs.cpp
File metadata and controls
78 lines (66 loc) · 2.44 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
#include "OdbDesignArgs.h"
#include <sstream>
namespace Odb::Lib::App
{
OdbDesignArgs::OdbDesignArgs(int argc, char* argv[])
: CommandLineArgs(argc, argv)
{
}
int OdbDesignArgs::port() const
{
return intArg("port", DEFAULT_PORT);
}
bool OdbDesignArgs::useHttps() const
{
return boolArg("use-https", DEFAULT_USE_HTTPS);
}
std::string OdbDesignArgs::sslDir() const
{
return stringArg("ssl-dir", DEFAULT_SSL_DIR);
}
std::string OdbDesignArgs::designsDir() const
{
return stringArg("designs-dir", DEFAULT_DESIGNS_DIR);
}
std::string OdbDesignArgs::templatesDir() const
{
return stringArg("templates-dir", DEFAULT_TEMPLATES_DIR);
}
bool OdbDesignArgs::help() const
{
return boolArg("help", DEFAULT_HELP);
}
std::string OdbDesignArgs::loadDesign() const
{
return stringArg("load-design", DEFAULT_LOAD_DESIGN);
}
bool OdbDesignArgs::loadAll() const
{
return boolArg("load-all", DEFAULT_LOAD_ALL);
}
bool OdbDesignArgs::disableAuthentication() const
{
return boolArg("disable-authentication", DEFAULT_DISABLE_AUTH);
}
int OdbDesignArgs::heartbeatInterval() const
{
return intArg("heartbeat-interval", DEFAULT_HEARTBEAT_INTERVAL);
}
std::string OdbDesignArgs::getUsageString() const
{
std::stringstream ss;
ss << "Usage: " << executableName() << " [options]\n";
ss << "Options:\n";
ss << " --port <port> Port to listen on (default: " << DEFAULT_PORT << ")\n";
ss << " --use-https Use HTTPS (default: " << (DEFAULT_USE_HTTPS ? "true" : "false") << ")\n";
ss << " --ssl-dir <dir> Directory containing SSL certificate and key files (default: " << DEFAULT_SSL_DIR << ")\n";
ss << " --designs-dir <dir> Directory containing design files (default: " << DEFAULT_DESIGNS_DIR << ")\n";
ss << " --templates-dir <dir> Directory containing template files (default: " << DEFAULT_TEMPLATES_DIR << ")\n";
ss << " --load-design <design> Design to load on startup (default: " << DEFAULT_LOAD_DESIGN << ")\n";
ss << " --load-all Load all designs on startup (default: " << (DEFAULT_LOAD_ALL ? "true" : "false") << ")\n";
ss << " --disable-authentication Disable authentication (default: " << (DEFAULT_DISABLE_AUTH ? "true" : "false") << ")\n";
ss << " --heartbeat-interval <interval> Heartbeat interval in seconds (default: " << DEFAULT_HEARTBEAT_INTERVAL << ")\n";
ss << " --help Print this help message\n";
return ss.str();
}
}