Add check for missing project action arguments.

This commit is contained in:
realaltffour 2020-04-12 09:44:19 +03:00
parent 688fc19356
commit 7c447f69d1
No known key found for this signature in database
GPG Key ID: 7115CD2AC9A76A56
1 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,11 @@ void proj_dispatch(const std::vector<std::string>& arguments) {
exit(1);
}
/* Get action type. */
/* Get action param. */
if (arguments.size() <= 1) {
std::cout << "No arguments passed to project action!" << std::endl;
exit(1);
}
auto type_action = std::string{""};
for (size_t i = 1; i < arguments.size(); i++) {
type_action += arguments[i];