| 138 | struct_identity autonestbox_options::_identity(sizeof(autonestbox_options), &df::allocator_fn<autonestbox_options>, NULL, "autonestbox_options", NULL, autonestbox_options_fields); |
| 139 | |
| 140 | static command_result df_autonestbox(color_ostream &out, vector<string> ¶meters) { |
| 141 | if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { |
| 142 | out.printerr("Cannot run {} without a loaded fort.\n", plugin_name); |
| 143 | return CR_FAILURE; |
| 144 | } |
| 145 | |
| 146 | autonestbox_options opts; |
| 147 | if (!Lua::CallLuaModuleFunction(out, "plugins.autonestbox", "parse_commandline", std::make_tuple(&opts, parameters)) |
| 148 | || opts.help) |
| 149 | return CR_WRONG_USAGE; |
| 150 | |
| 151 | if (opts.now) { |
| 152 | did_complain = false; |
| 153 | autonestbox_cycle(out); |
| 154 | } |
| 155 | else { |
| 156 | out << "autonestbox is " << (is_enabled ? "" : "not ") << "running" << std::endl; |
| 157 | } |
| 158 | return CR_OK; |
| 159 | } |
| 160 | |
| 161 | ///////////////////////////////////////////////////// |
| 162 | // cycle logic |
nothing calls this directly
no test coverage detected