Mercurial > irccd
diff irccdctl/main.cpp @ 428:ce1903f4bdb7 release-2.1
Fix #637: check for domain and family options
The decision was not clear between the two option names, the documentation
stated to use family but the code checked for family.
Accept both for compatibility purposes and unify the documentation using the
family name.
Task: #637
Errata: 20170218
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 18 Feb 2017 09:08:51 +0100 |
parents | c6fbb6e0e06d |
children | 9be4f8a5cf1a |
line wrap: on
line diff
--- a/irccdctl/main.cpp Thu Feb 16 18:53:30 2017 +0100 +++ b/irccdctl/main.cpp Sat Feb 18 09:08:51 2017 +0100 @@ -132,13 +132,13 @@ int domain = AF_INET; - if ((it = sc.find("domain")) != sc.end()) { + if ((it = sc.find("domain")) != sc.end() || (it = sc.find("family")) != sc.end()) { if (it->value() == "ipv6") { domain = AF_INET6; } else if (it->value() == "ipv4") { domain = AF_INET; } else { - throw std::invalid_argument("invalid domain: " + it->value()); + throw std::invalid_argument("invalid family: " + it->value()); } }