refactoring
This commit is contained in:
parent
effafd3e91
commit
34c4a9c508
@ -156,6 +156,7 @@ ncrypt
|
||||
netdev
|
||||
nlohmann
|
||||
nmake
|
||||
nmakeprg
|
||||
noappledouble
|
||||
nocache
|
||||
nocloseprocess
|
||||
@ -165,6 +166,7 @@ nopath
|
||||
npubbytes
|
||||
ntfs
|
||||
ntstatus
|
||||
nv_darcula_enable_dap
|
||||
nvimrc_cfg
|
||||
nypadymka
|
||||
oleaut32
|
||||
|
19
src/main.cpp
19
src/main.cpp
@ -39,7 +39,12 @@ std::size_t PROVIDER_INDEX{0U};
|
||||
auto main(int argc, char **argv) -> int {
|
||||
repertory_init();
|
||||
|
||||
std::vector<const char *> args(argv, argv + argc);
|
||||
std::vector<const char *> args;
|
||||
{
|
||||
auto args_span = std::span(argv, static_cast<std::size_t>(argc));
|
||||
std::copy(args_span.begin(), args_span.end(), std::back_inserter(args));
|
||||
}
|
||||
|
||||
#ifdef REPERTORY_TESTING
|
||||
#ifdef _WIN32
|
||||
if (utils::cli::has_option(args, "--provider_index")) {
|
||||
@ -81,9 +86,9 @@ auto main(int argc, char **argv) -> int {
|
||||
std::string unique_id;
|
||||
if ((res == exit_code::success) && (prov == provider_type::remote)) {
|
||||
std::string data;
|
||||
if ((res = utils::cli::parse_string_option(
|
||||
args, utils::cli::options::remote_mount_option, data)) ==
|
||||
exit_code::success) {
|
||||
res = utils::cli::parse_string_option(
|
||||
args, utils::cli::options::remote_mount_option, data);
|
||||
if (res == exit_code::success) {
|
||||
const auto parts = utils::string::split(data, ':');
|
||||
if (parts.size() != 2) {
|
||||
std::cerr << "Invalid syntax for host/port '-rm "
|
||||
@ -111,9 +116,9 @@ auto main(int argc, char **argv) -> int {
|
||||
#ifdef REPERTORY_ENABLE_S3
|
||||
if ((res == exit_code::success) && (prov == provider_type::s3)) {
|
||||
std::string data;
|
||||
if ((res = utils::cli::parse_string_option(args,
|
||||
utils::cli::options::name_option,
|
||||
data)) == exit_code::success) {
|
||||
res = utils::cli::parse_string_option(
|
||||
args, utils::cli::options::name_option, data);
|
||||
if (res == exit_code::success) {
|
||||
unique_id = utils::string::trim(data);
|
||||
if (unique_id.empty()) {
|
||||
std::cerr << "Name of S3 instance not provided" << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user