diff options
| author | Alexander Gavrilov | 2012-01-28 16:03:56 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-01-28 16:03:56 +0400 |
| commit | fa4fb4b407b701d707ac3e3a4a0e6804cca2c526 (patch) | |
| tree | da7e5bf1119f33f7678e0a55adacd307788bb65a /plugins/weather.cpp | |
| parent | c59f5c16421f62f88697624457b4b390306ca5a5 (diff) | |
| download | dfhack-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/weather.cpp')
| -rw-r--r-- | plugins/weather.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/plugins/weather.cpp b/plugins/weather.cpp index 73eda774..9c161c8e 100644 --- a/plugins/weather.cpp +++ b/plugins/weather.cpp @@ -23,7 +23,15 @@ DFhackCExport const char * plugin_name ( void ) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) { commands.clear(); - commands.push_back(PluginCommand("weather", "Print the weather map or change weather.",weather)); + commands.push_back(PluginCommand( + "weather", "Print the weather map or change weather.", + weather, false, + " Prints the current weather map by default.\n" + "Options:\n" + " snow - make it snow everywhere.\n" + " rain - make it rain.\n" + " clear - clear the sky.\n" + )); return CR_OK; } @@ -40,7 +48,6 @@ DFhackCExport command_result weather (Core * c, vector <string> & parameters) bool snow = false; bool rain = false; bool clear = false; - bool help = false; for(int i = 0; i < parameters.size();i++) { if(parameters[i] == "rain") @@ -53,18 +60,8 @@ DFhackCExport command_result weather (Core * c, vector <string> & parameters) lock = true; else if(parameters[i] == "unlock") unlock = true; - else if(parameters[i] == "help" || parameters[i] == "?") - help = true; - } - if(help) - { - c->con.print("Prints the current weather map by default.\n" - "Options:\n" - "snow - make it snow everywhere.\n" - "rain - make it rain.\n" - "clear - clear the sky.\n" - ); - return CR_OK; + else + return CR_WRONG_USAGE; } if(lock && unlock) { |
