"vscode:/vscode.git/clone" did not exist on "dbf987145cb697fdbb36d2ea920625373d6ea119"
Commit 30b7e786 authored by Paul's avatar Paul
Browse files

Format

parent 6cfe98a5
...@@ -377,12 +377,10 @@ struct argument_parser ...@@ -377,12 +377,10 @@ struct argument_parser
}; };
} }
template<class T> template <class T>
void set_exe_name_to(T& x) void set_exe_name_to(T& x)
{ {
actions.push_back([&](auto& self) { actions.push_back([&](auto& self) { x = self.exe_name; });
x = self.exe_name;
});
} }
bool bool
...@@ -449,7 +447,7 @@ struct argument_parser ...@@ -449,7 +447,7 @@ struct argument_parser
} }
} }
} }
for(auto&& action:actions) for(auto&& action : actions)
action(*this); action(*this);
return false; return false;
} }
......
...@@ -591,14 +591,16 @@ struct main_command ...@@ -591,14 +591,16 @@ struct main_command
auto it = std::find_if(wrong_commands.begin(), wrong_commands.end(), [](const auto& c) { auto it = std::find_if(wrong_commands.begin(), wrong_commands.end(), [](const auto& c) {
return get_commands().count(c) > 0; return get_commands().count(c) > 0;
}); });
if (it == wrong_commands.end()) if(it == wrong_commands.end())
{ {
std::cout << "'" << color::fg_yellow << wrong_commands.front() << color::reset << "' is not a valid command." << std::endl; std::cout << "'" << color::fg_yellow << wrong_commands.front() << color::reset
<< "' is not a valid command." << std::endl;
std::cout << get_command_help("Available commands:") << std::endl; std::cout << get_command_help("Available commands:") << std::endl;
} }
else else
{ {
std::cout << "command '" << color::fg_yellow << *it << color::reset << "' must be first argument" << std::endl; std::cout << "command '" << color::fg_yellow << *it << color::reset
<< "' must be first argument" << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << color::fg_yellow << "USAGE:" << color::reset << std::endl; std::cout << color::fg_yellow << "USAGE:" << color::reset << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment