summaryrefslogtreecommitdiff
path: root/plugins/colonies.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-08-09 01:50:22 +0200
committerPetr Mrázek2011-08-09 01:50:22 +0200
commitcc19180ac00c767abe164ad275fab6ab4aeb0888 (patch)
tree9e95f92b3f4e5a5cb23409eb9a3acfd1d958acd2 /plugins/colonies.cpp
parent8fd437dbc1caebf7a8f8b8668e2fe6a2b907f498 (diff)
downloaddfhack-cc19180ac00c767abe164ad275fab6ab4aeb0888.tar.gz
dfhack-cc19180ac00c767abe164ad275fab6ab4aeb0888.tar.bz2
dfhack-cc19180ac00c767abe164ad275fab6ab4aeb0888.tar.xz
Add 'help' options to a bunch of commands.
Diffstat (limited to 'plugins/colonies.cpp')
-rw-r--r--plugins/colonies.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/colonies.cpp b/plugins/colonies.cpp
index 4bba91ad..ce8beccb 100644
--- a/plugins/colonies.cpp
+++ b/plugins/colonies.cpp
@@ -22,9 +22,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
{
commands.clear();
commands.push_back(PluginCommand("colonies",
- "List or change wild colonies (ants hills and such)\
-\n Options: 'kill' = destroy all colonies\
-\n 'bees' = change all colonies to honey bees",
+ "List or change wild colonies (ants hills and such)",
colonies));
return CR_OK;
}
@@ -43,6 +41,7 @@ DFhackCExport command_result colonies (Core * c, vector <string> & parameters)
{
bool destroy = false;
bool convert = false;
+ bool help = false;
for(int i = 0; i < parameters.size();i++)
{
@@ -50,8 +49,20 @@ DFhackCExport command_result colonies (Core * c, vector <string> & parameters)
destroy = true;
else if(parameters[i] == "bees")
convert = true;
+ else if(parameters[i] == "help" || parameters[i] == "?")
+ {
+ help = true;
+ }
+ }
+ if(help)
+ {
+ c->con.print("Without any options, this command lists all the vermin colonies present.\n"
+ "Options:\n"
+ "kill - destroy colonies\n"
+ "bees - turn colonies into honey bees\n"
+ );
+ return CR_OK;
}
-
if (destroy && convert)
{
c->con.printerr("Kill or make bees? DECIDE!\n");