diff options
author | Benjamin Dobell <benjamin.dobell@glassechidna.com.au> | 2011-06-11 08:11:31 +0200 |
---|---|---|
committer | Benjamin Dobell <benjamin.dobell@glassechidna.com.au> | 2011-06-11 08:11:31 +0200 |
commit | 7cbd3c0f47524198ee25f417fba5acb0c690da44 (patch) | |
tree | 3538d119301ea384bf783963cc6e3d0102770962 | |
parent | Doh! Fixed the displayed version number. (diff) | |
download | Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar.gz Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar.bz2 Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar.lz Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar.xz Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.tar.zst Heimdall-7cbd3c0f47524198ee25f417fba5acb0c690da44.zip |
-rw-r--r-- | heimdall/source/InterfaceManager.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/heimdall/source/InterfaceManager.cpp b/heimdall/source/InterfaceManager.cpp index 107342b..26ef028 100644 --- a/heimdall/source/InterfaceManager.cpp +++ b/heimdall/source/InterfaceManager.cpp @@ -56,12 +56,12 @@ string InterfaceManager::dumpArgumentNames[kDumpArgCount * 2] = { string InterfaceManager::commonArgumentNames[kCommonArgCount * 2] = {
// --- Long Names ---
- "-verbose", "-no-reboot"
+ "-verbose", "-no-reboot",
"-delay",
// --- Short Names ---
- "v", "nobt"
+ "v", "nobt",
"d"
};
@@ -216,34 +216,37 @@ bool InterfaceManager::GetArguments(int argc, char **argv, map<string, string>& continue;
}
- // Check if the argument is a valid regular argument
- for (int i = actionValuelessArgumentCount; i < actionArgumentCount; i++)
+ if (argumentNames != nullptr)
{
- // Support for --<integer> and -<integer> parameters.
- if (argumentName.length() > 1 && argumentNames[i].compare("-%d") == 0)
+ // Check if the argument is a valid regular argument
+ for (int i = actionValuelessArgumentCount; i < actionArgumentCount; i++)
{
- if (atoi(argumentName.substr(1).c_str()) > 0 || argumentName.compare("-0") == 0)
+ // Support for --<integer> and -<integer> parameters.
+ if (argumentName.length() > 1 && argumentNames[i].compare("-%d") == 0)
{
- valid = true;
- break;
+ if (atoi(argumentName.substr(1).c_str()) > 0 || argumentName.compare("-0") == 0)
+ {
+ valid = true;
+ break;
+ }
}
- }
- else if (argumentNames[i].compare("%d") == 0)
- {
- if (atoi(argumentName.c_str()) > 0 || argumentName.compare("0") == 0)
+ else if (argumentNames[i].compare("%d") == 0)
+ {
+ if (atoi(argumentName.c_str()) > 0 || argumentName.compare("0") == 0)
+ {
+ argumentName = "-" + argumentName;
+ valid = true;
+ break;
+ }
+ }
+
+ if (argumentName == argumentNames[i] || argumentName == argumentNames[actionArgumentCount + i])
{
- argumentName = "-" + argumentName;
+ argumentName = argumentNames[i];
valid = true;
break;
}
}
-
- if (argumentName == argumentNames[i] || argumentName == argumentNames[actionArgumentCount + i])
- {
- argumentName = argumentNames[i];
- valid = true;
- break;
- }
}
if (!valid)
@@ -252,7 +255,7 @@ bool InterfaceManager::GetArguments(int argc, char **argv, map<string, string>& for (int i = commonValuelessArgumentCount; i < commonArgumentCount; i++)
{
// Support for --<integer> and -<integer> parameters.
- if (argumentName.length() > 1 && argumentNames[i].compare("-%d"))
+ if (argumentName.length() > 1 && commonArgumentNames[i].compare("-%d"))
{
if (atoi(argumentName.substr(1).c_str()) > 0 || argumentName.compare("-0") == 0)
{
@@ -260,7 +263,7 @@ bool InterfaceManager::GetArguments(int argc, char **argv, map<string, string>& break;
}
}
- else if (argumentNames[i].compare("%d"))
+ else if (commonArgumentNames[i].compare("%d"))
{
if (atoi(argumentName.c_str()) > 0 || argumentName.compare("0") == 0)
{
|