summaryrefslogtreecommitdiff
path: root/plugins/cleanowned.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-01-28 16:03:56 +0400
committerAlexander Gavrilov2012-01-28 16:03:56 +0400
commitfa4fb4b407b701d707ac3e3a4a0e6804cca2c526 (patch)
treeda7e5bf1119f33f7678e0a55adacd307788bb65a /plugins/cleanowned.cpp
parentc59f5c16421f62f88697624457b4b390306ca5a5 (diff)
downloaddfhack-fa4fb4b407b701d707ac3e3a4a0e6804cca2c526.tar.gz
dfhack-fa4fb4b407b701d707ac3e3a4a0e6804cca2c526.tar.bz2
dfhack-fa4fb4b407b701d707ac3e3a4a0e6804cca2c526.tar.xz
Modify a number of commands to use CR_WRONG_USAGE for displaying help.
Diffstat (limited to 'plugins/cleanowned.cpp')
-rw-r--r--plugins/cleanowned.cpp44
1 files changed, 18 insertions, 26 deletions
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp
index dec59163..a2ec4b76 100644
--- a/plugins/cleanowned.cpp
+++ b/plugins/cleanowned.cpp
@@ -36,9 +36,23 @@ DFhackCExport const char * plugin_name ( void )
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{
commands.clear();
- commands.push_back(PluginCommand("cleanowned",
- "Confiscates and dumps garbage owned by dwarfs.",
- df_cleanowned));
+ commands.push_back(PluginCommand(
+ "cleanowned", "Confiscates and dumps garbage owned by dwarfs.",
+ df_cleanowned, false,
+ " This tool lets you confiscate and dump all the garbage\n"
+ " dwarves ultimately accumulate.\n"
+ " By default, only rotten and dropped food is confiscated.\n"
+ "Options:\n"
+ " dryrun - don't actually do anything, just print what would be done.\n"
+ " scattered - confiscate owned items on the ground\n"
+ " all - confiscate everything\n"
+ " x - confiscate & dump 'x' and worse damaged items\n"
+ " X - confiscate & dump 'X' and worse damaged items\n"
+ "Example:\n"
+ " confiscate scattered X\n"
+ " This will confiscate rotten and dropped food, garbage on the floors\n"
+ " and any worn items wit 'X' damage and above.\n"
+ ));
return CR_OK;
}
@@ -67,30 +81,8 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete
wear_dump_level = 1;
else if(param == "X")
wear_dump_level = 2;
- else if(param == "?" || param == "help")
- {
- c->con.print("This tool lets you confiscate and dump all the garbage\n"
- "dwarves ultimately accumulate.\n"
- "By default, only rotten and dropped food is confiscated.\n"
- "Options:\n"
- " dryrun - don't actually do anything, just print what would be done.\n"
- " scattered - confiscate owned items on the ground\n"
- " all - confiscate everything\n"
- " x - confiscate & dump 'x' and worse damaged items\n"
- " X - confiscate & dump 'X' and worse damaged items\n"
- " ? - this help\n"
- "Example:\n"
- " confiscate scattered X\n"
- " This will confiscate rotten and dropped food, garbage on the floors\n"
- " and any worn items wit 'X' damage and above.\n"
- );
- return CR_OK;
- }
else
- {
- c->con.printerr("Parameter '%s' is not valid. See 'cleanowned help'.\n",param.c_str());
- return CR_FAILURE;
- }
+ return CR_WRONG_USAGE;
}
CoreSuspender suspend(c);