MCPcopy Create free account
hub / github.com/Stiffstream/restinio / parse

Method parse

dev/sample/hello_world_sendfile_https/main.cpp:30–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 bool m_trace_server{ false };
29
30 static app_args_t
31 parse( int argc, const char * argv[] )
32 {
33 using namespace restinio_helpers;
34
35 app_args_t result;
36
37 process_cmd_line_args( argc, argv, result,
38 cmd_line_arg_t{
39 result.m_address,
40 "-a", "--address",
41 "address to listen (default: {})"
42 },
43 cmd_line_arg_t{
44 result.m_port,
45 "-p", "--port",
46 "port to listen (default: {})"
47 },
48 cmd_line_arg_t{
49 result.m_pool_size,
50 "-n", "--thread-pool-size",
51 "size of a thread pool to run server (default: {})"
52 },
53 cmd_line_arg_t{
54 result.m_certs_dir,
55 "-C", "--certs-dir",
56 "directory with server.pem, key.pem, "
57 "dh2048.pem (default: {})"
58 },
59 cmd_line_arg_t{
60 result.m_file,
61 "-f", "--file",
62 "path to a file that will be served as response"
63 },
64 cmd_line_arg_t{
65 result.m_data_offset,
66 "-o", "--data-offset",
67 "offset of the data portion in file (default: {})"
68 },
69 cmd_line_arg_t{
70 result.m_data_size,
71 "-s", "--data-size",
72 "size of the data portion in file (default: to the end of file)"
73 },
74 cmd_line_arg_t{
75 result.m_content_type,
76 "-c", "--content-type",
77 "A value of 'Content-Type' header field (default: {})"
78 },
79 cmd_line_arg_t{
80 result.m_trace_server,
81 "-t", "--trace",
82 "enable trace server"
83 } );
84
85 if( result.m_file.empty() )
86 throw std::runtime_error{
87 "Name of file to be used as a response "

Callers

nothing calls this directly

Calls 2

process_cmd_line_argsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected