86 const char *
const *
const argv,
90 if (arg_index < argc && std::strcmp(argv[arg_index],
"memory") == 0)
95 else if (arg_index < argc && std::strcmp(argv[arg_index],
"server") == 0)
99 else if (arg_index + 1 < argc && std::strcmp(argv[arg_index],
"interpreted") == 0)
109 else if (arg_index < argc + 1 && std::strcmp(argv[arg_index],
"--read") == 0)
117 const char *
const file_name = argv[arg_index];
120 out <<
"Opening interpreted file... ";
131 else if (arg_index + 3 < argc && std::strcmp(argv[arg_index],
"sftp") == 0)
136 if (arg_index + 4 < argc && std::strcmp(argv[arg_index],
"--port") == 0)
139 port = uint16_t(std::atoi(argv[arg_index++]));
143 if (arg_index + 4 < argc && std::strcmp(argv[arg_index],
"--verbosity") == 0)
146 verbosity = std::atoi(argv[arg_index++]);
149 const char *
const user = argv[arg_index++];
150 const char *
const host = argv[arg_index++];
152 out <<
"Creating ssh Session... ";
155 ssh_session.emplace(user, host, port, verbosity);
159 out <<
"Initializing sftp... ";
162 sftp.emplace(*ssh_session);
166 const char *
const file_name = argv[arg_index++];
168 out <<
"Opening file... ";
170 file.reset(
new SFTP_File(*sftp, file_name));
176 else if (arg_index < argc && std::strcmp(argv[arg_index],
"curl") == 0)
180 bool verbose =
false;
181 if (arg_index < argc && std::strcmp(argv[arg_index],
"--verbose") == 0)
187 const char * url =
nullptr;
189 if (arg_index < argc)
191 url = argv[arg_index];
204#ifdef JOEDB_HAS_BROTLI
205 else if (arg_index < argc + 1 && std::strcmp(argv[arg_index],
"brotli") == 0)
215 else if (arg_index < argc + 1 && std::strcmp(argv[arg_index],
"--read") == 0)
223 const char *
const file_name = argv[arg_index];
226 out <<
"Opening brotli file... ";
239 if (arg_index < argc && std::strcmp(argv[arg_index],
"file") == 0)
244 if (arg_index < argc && !default_only)
246 for (
size_t i = 0; i < open_modes; i++)
252 if (option == argv[arg_index])
260 const char *file_name =
nullptr;
261 if (arg_index < argc)
263 file_name = argv[arg_index];
267 out <<
"Opening local file (open_mode = ";
271 if (file_name && *file_name)
273 file.reset(
new File(file_name, open_mode));