| 335 | } |
| 336 | |
| 337 | bool ConfigManager::ResetConfig() { |
| 338 | try { |
| 339 | std::string config_file = GetConfigFilePath(); |
| 340 | |
| 341 | // Delete the config file if it exists |
| 342 | if (fs::exists(config_file)) { |
| 343 | fs::remove(config_file); |
| 344 | } |
| 345 | |
| 346 | // Reset in-memory config to default |
| 347 | current_config_ = GetDefaultConfig(); |
| 348 | |
| 349 | // Reload to apply environment variables if any |
| 350 | LoadConfig(); |
| 351 | |
| 352 | return true; |
| 353 | } catch (const std::exception& e) { |
| 354 | std::cerr << "Failed to reset configuration: " << e.what() << std::endl; |
| 355 | return false; |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | } // namespace mnncli |
| 360 | |