summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-11-14 22:50:16 +0000
committerzuu <zuu@openttd.org>2013-11-14 22:50:16 +0000
commita31b46ba840f1478666001283200b8176314b1f8 (patch)
tree7f3be41b3b8f6337dd227f66ee8f42887f4a4bb1 /src
parent90889727386a31ab6c8b0af1cc59c0b684934f78 (diff)
downloadopenttd-a31b46ba840f1478666001283200b8176314b1f8.tar.xz
(svn r26000) -Add: Optional filter parameter to the 'content state' console command, to limit the content list to only content where the name match the filter
Diffstat (limited to 'src')
-rw-r--r--src/console_cmds.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 8bee1b954..1a4ea9239 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -1741,12 +1741,12 @@ DEF_CONSOLE_CMD(ConContent)
}
if (argc <= 1) {
- IConsoleHelp("Query, select and download content. Usage: 'content update|upgrade|select [all|id]|unselect [all|id]|state|download'");
+ IConsoleHelp("Query, select and download content. Usage: 'content update|upgrade|select [all|id]|unselect [all|id]|state [filter]|download'");
IConsoleHelp(" update: get a new list of downloadable content; must be run first");
IConsoleHelp(" upgrade: select all items that are upgrades");
IConsoleHelp(" select: select a specific item given by its id or 'all' to select all. If no parameter is given, all selected content will be listed");
IConsoleHelp(" unselect: unselect a specific item given by its id or 'all' to unselect all");
- IConsoleHelp(" state: show the download/select state of all downloadable content");
+ IConsoleHelp(" state: show the download/select state of all downloadable content. Optionally give a filter string");
IConsoleHelp(" download: download all content you've selected");
return true;
}
@@ -1793,6 +1793,7 @@ DEF_CONSOLE_CMD(ConContent)
if (strcasecmp(argv[1], "state") == 0) {
IConsolePrintF(CC_WHITE, "id, type, state, name");
for (ConstContentIterator iter = _network_content_client.Begin(); iter != _network_content_client.End(); iter++) {
+ if (argc > 2 && strcasestr((*iter)->name, argv[2]) == NULL) continue;
OutputContentState(*iter);
}
return true;