1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

new-argparse: finish new argparse integration and clean up

This commit is contained in:
IntelOrca
2016-01-10 21:03:45 +00:00
parent 3f0073f29c
commit e9d222fdd3
18 changed files with 145 additions and 820 deletions

View File

@@ -1,9 +1,27 @@
extern "C"
{
#include "../interface/screenshot.h"
}
#include "CommandLine.hpp"
static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator);
const CommandLineCommand CommandLine::ScreenshotCommands[]
{
// Main commands
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]", nullptr, nullptr),
DefineCommand("", "<file> <output_image> giant <zoom> <rotation>", nullptr, nullptr),
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]", nullptr, HandleScreenshot),
DefineCommand("", "<file> <output_image> giant <zoom> <rotation>", nullptr, HandleScreenshot),
CommandTableEnd
};
static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator)
{
const char * * argv = (const char * *)argEnumerator->GetArguments() + argEnumerator->GetIndex() - 1;
int argc = argEnumerator->GetCount() - argEnumerator->GetIndex() + 1;
int result = cmdline_for_screenshot(argv, argc);
if (result < 0) {
return EXITCODE_FAIL;
}
return EXITCODE_OK;
}