Mercurial > irccd
changeset 756:1b4f82c952d6
Irccd: style (main.cpp)
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 06 Aug 2018 12:40:00 +0200 |
parents | 580b030c875f |
children | 97b356010785 |
files | irccd/main.cpp |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/irccd/main.cpp Mon Aug 06 12:31:00 2018 +0200 +++ b/irccd/main.cpp Mon Aug 06 12:40:00 2018 +0200 @@ -105,9 +105,8 @@ // {{{ parse -option::result parse(int& argc, char**& argv) +auto parse(int& argc, char**& argv) -> option::result { - // Parse command line options. option::result result; try { @@ -145,14 +144,14 @@ // {{{ open -config open(const option::result& result) +auto open(const option::result& result) -> config { auto it = result.find("-c"); if (it != result.end() || (it = result.find("--config")) != result.end()) return config(it->second); - auto cfg = config::search("irccd.conf"); + const auto cfg = config::search("irccd.conf"); if (!cfg) throw std::runtime_error("no configuration file could be found"); @@ -177,7 +176,7 @@ init(argc, argv); - auto options = parse(argc, argv); + const auto options = parse(argc, argv); instance->transports().get_commands().push_back(std::make_unique<plugin_config_command>()); instance->transports().get_commands().push_back(std::make_unique<plugin_info_command>());