summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/options.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2011-11-09 10:28:30 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2011-11-09 10:28:30 +0000
commite0f276b74bfeb2804d476fc3e8b254990a1ccaa3 (patch)
treead330cd1bc6087ace6cdc2bb2c096f2d15212ecb /src/lib/util/options.c
parent7c00fd2a52849905a602a25dbced178ccb21e72d (diff)
Change order of parsing in emu_options, so first all slot devices are set and then image devices.
Also update lib/util/options.c so now parsing is not stopped on first unknown parameter, this way order of options in command line is not important for dynamic options (no whatsnew)
Diffstat (limited to 'src/lib/util/options.c')
-rw-r--r--src/lib/util/options.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index ed1a62a6f6c..88c173c1c65 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -346,6 +346,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri
// iterate through arguments
int unadorned_index = 0;
+ bool retVal = true;
for (int arg = 1; arg < argc; arg++)
{
// determine the entry name to search for
@@ -358,7 +359,9 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri
if (curentry == NULL)
{
error_string.catprintf("Error: unknown option: %s\n", curarg);
- return false;
+ retVal = false;
+ if (!is_unadorned) arg++;
+ continue;
}
// process commands first
@@ -391,7 +394,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri
// set the new data
validate_and_set_data(*curentry, newdata, priority, error_string);
}
- return true;
+ return retVal;
}