mirror of
https://github.com/monero-project/monero.git
synced 2025-01-28 18:56:31 +02:00
Remove conflicting argument detection
This commit is contained in:
parent
e62f3b3616
commit
770c712223
@ -51,13 +51,6 @@ namespace
|
|||||||
const command_line::arg_descriptor<bool> arg_help_daemon = {"daemon-help", "Display daemon command help"};
|
const command_line::arg_descriptor<bool> arg_help_daemon = {"daemon-help", "Display daemon command help"};
|
||||||
const command_line::arg_descriptor<std::string> arg_daemon_command = {"send-command", "Send a command string to the running daemon"};
|
const command_line::arg_descriptor<std::string> arg_daemon_command = {"send-command", "Send a command string to the running daemon"};
|
||||||
|
|
||||||
bool is_there_more_than_one(po::variables_map vm, std::initializer_list<std::string> arg_names) {
|
|
||||||
int count = 0;
|
|
||||||
for (auto & arg_name : arg_names) {
|
|
||||||
if (vm[arg_name].empty() || !vm[arg_name].defaulted()) ++count;
|
|
||||||
}
|
|
||||||
return count > 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@ -121,19 +114,6 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
po::store(po::parse_command_line(argc, argv, argument_spec), vm);
|
po::store(po::parse_command_line(argc, argv, argument_spec), vm);
|
||||||
|
|
||||||
if (is_there_more_than_one(vm,
|
|
||||||
{
|
|
||||||
#ifndef WIN32
|
|
||||||
arg_start_daemon.name
|
|
||||||
#endif
|
|
||||||
, arg_stop_daemon.name
|
|
||||||
, arg_help_daemon.name
|
|
||||||
, arg_daemon_command.name
|
|
||||||
}))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
if (!success) return 1;
|
if (!success) return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user