fix very stupid out of range error
This commit is contained in:
@@ -204,8 +204,7 @@ public:
|
||||
}
|
||||
|
||||
std::string GetArg(std::string w, std::string def = "") {
|
||||
if (!FindShort(m_args, w))
|
||||
return def;
|
||||
if (!FindShort(m_args, w)) return def;
|
||||
for (size_t i = 0; i < m_args.size() - 1; i++) {
|
||||
if (m_args[i] == std::string("-" + w)) {
|
||||
return m_args[i + 1];
|
||||
@@ -268,6 +267,7 @@ public:
|
||||
|
||||
void Execute() {
|
||||
command::ArgumentList arglist;
|
||||
if (m_args.size() > 1) {
|
||||
for (const auto &c : m_commands) {
|
||||
if (c.GetName() == m_args[1]) {
|
||||
for (const auto &j : c.GetArgs()) {
|
||||
@@ -291,6 +291,7 @@ public:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
PrintHelp("");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user