static void InitCommandTable(cmdScannerADT cs) { DefineCommand(cs, "node", NodeCmdFn); DefineCommand(cs, "connect", ConnectCmdFn); DefineCommand(cs, "list", ListCmdFn); DefineCommand(cs, "dfs", DFSCmdFn); DefineCommand(cs, "bfs", BFSCmdFn); DefineCommand(cs, "source", SourceCmdFn); DefineCommand(cs, "help", HelpCmdFn); DefineCommand(cs, "quit", QuitCmdFn); }
static void InitCommandTable(cmdScannerADT cs) { DefineCommand(cs, "lookup", LookupCmdFn); DefineCommand(cs, "enter", EnterCmdFn); DefineCommand(cs, "clear", ClearCmdFn); DefineCommand(cs, "list", ListCmdFn); DefineCommand(cs, "help", HelpCmdFn); DefineCommand(cs, "quit", QuitCmdFn); }
static const char* _mode; // clang-format off static constexpr const CommandLineOptionDefinition SpriteOptions[] { { CMDLINE_TYPE_STRING, &_mode, 'm', "mode", "the type of sprite conversion <" SZ_DEFAULT "|" SZ_CLOSEST "|" SZ_DITHERING ">" }, OptionTableEnd }; static exitcode_t HandleSprite(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::SpriteCommands[] { // Main commands DefineCommand("append", "<spritefile> <input> [x_offset y_offset]", SpriteOptions, HandleSprite), DefineCommand("build", "<spritefile> <json path> [silent]", SpriteOptions, HandleSprite), DefineCommand("create", "<spritefile>", SpriteOptions, HandleSprite), DefineCommand("details", "<spritefile> [idx]", SpriteOptions, HandleSprite), DefineCommand("export", "<spritefile> <idx> <output>", SpriteOptions, HandleSprite), DefineCommand("exportall", "<spritefile> <output directory>", SpriteOptions, HandleSprite), CommandTableEnd }; // clang-format on static exitcode_t HandleSprite(CommandLineArgEnumerator* argEnumerator) { if (String::Equals(_mode, SZ_CLOSEST, true)) gSpriteMode = 1; else if (String::Equals(_mode, SZ_DITHERING, true)) gSpriteMode = 2;
int32_t result = cmdline_for_bench_sprite_sort(argc, argv); if (result < 0) { return EXITCODE_FAIL; } return EXITCODE_OK; } #else static exitcode_t HandleBenchSpriteSort(CommandLineArgEnumerator* argEnumerator) { log_error("Sorry, Google benchmark not enabled in this build"); return EXITCODE_FAIL; } #endif // USE_BENCHMARK const CommandLineCommand CommandLine::BenchSpriteSortCommands[]{ #ifdef USE_BENCHMARK DefineCommand( "", "[<file>]... [--benchmark_list_tests={true|false}] [--benchmark_filter=<regex>] [--benchmark_min_time=<min_time>] " "[--benchmark_repetitions=<num_repetitions>] [--benchmark_report_aggregates_only={true|false}] " "[--benchmark_format=<console|json|csv>] [--benchmark_out=<filename>] [--benchmark_out_format=<json|console|csv>] " "[--benchmark_color={auto|true|false}] [--benchmark_counters_tabular={true|false}] [--v=<verbosity>]", nullptr, HandleBenchSpriteSort), CommandTableEnd #else DefineCommand("", "*** SORRY NOT ENABLED IN THIS BUILD ***", nullptr, HandleBenchSpriteSort), CommandTableEnd #endif // USE_BENCHMARK };
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, 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(); int argc = argEnumerator->GetCount() - argEnumerator->GetIndex(); int result = cmdline_for_screenshot(argv, argc); if (result < 0) { return EXITCODE_FAIL; } return EXITCODE_OK; }
{ CMDLINE_TYPE_SWITCH, &_removeShell, 'd', "remove", "remove shell integration" }, }; static exitcode_t HandleCommandRegisterShell(CommandLineArgEnumerator * enumerator); #endif static void PrintAbout(); static void PrintVersion(); static void PrintLaunchInformation(); const CommandLineCommand CommandLine::RootCommands[] { // Main commands #ifndef DISABLE_HTTP DefineCommand("", "<uri>", StandardOptions, HandleNoCommand ), DefineCommand("edit", "<uri>", StandardOptions, HandleCommandEdit ), #else DefineCommand("", "<path>", StandardOptions, HandleNoCommand ), DefineCommand("edit", "<path>", StandardOptions, HandleCommandEdit ), #endif DefineCommand("intro", "", StandardOptions, HandleCommandIntro ), #ifndef DISABLE_NETWORK DefineCommand("host", "<uri>", StandardOptions, HandleCommandHost ), DefineCommand("join", "<hostname>", StandardOptions, HandleCommandJoin ), #endif DefineCommand("set-rct2", "<path>", StandardOptions, HandleCommandSetRCT2), DefineCommand("convert", "<source> <destination>", StandardOptions, CommandLine::HandleCommandConvert), DefineCommand("scan-objects", "<path>", StandardOptions, HandleCommandScanObjects), DefineCommand("handle-uri", "openrct2://.../", StandardOptions, CommandLine::HandleCommandUri),