aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-12 21:54:43 +0000
committerJohannes Schickel2010-10-12 21:54:43 +0000
commit1842de4b0035854f271a40dcaa514cdba66bcf57 (patch)
tree881fea9affe77ee707d6639fea2dc93b099ead9c
parent69b618a8f5517c609a5e94d9609dc27aea2ad573 (diff)
downloadscummvm-rg350-1842de4b0035854f271a40dcaa514cdba66bcf57.tar.gz
scummvm-rg350-1842de4b0035854f271a40dcaa514cdba66bcf57.tar.bz2
scummvm-rg350-1842de4b0035854f271a40dcaa514cdba66bcf57.zip
COMMON: Let --list-targets output all targets in an alphabetical list again.
svn-id: r53183
-rw-r--r--base/commandLine.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 6fbdb55506..5a45ed74a1 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -578,6 +578,10 @@ static void listTargets() {
using namespace Common;
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
ConfigManager::DomainMap::const_iterator iter;
+
+ Common::Array<Common::String> targets;
+ targets.reserve(domains.size());
+
for (iter = domains.begin(); iter != domains.end(); ++iter) {
Common::String name(iter->_key);
Common::String description(iter->_value.getVal("description"));
@@ -592,9 +596,13 @@ static void listTargets() {
description = g.description();
}
- printf("%-20s %s\n", name.c_str(), description.c_str());
-
+ targets.push_back(Common::String::printf("%-20s %s", name.c_str(), description.c_str()));
}
+
+ Common::sort(targets.begin(), targets.end());
+
+ for (Common::Array<Common::String>::const_iterator i = targets.begin(), end = targets.end(); i != end; ++i)
+ printf("%s\n", i->c_str());
}
/** List all saves states for the given target. */