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