+ } else if (strcmp(param, "standalone") == 0) {
+ target = STANDALONE;
+ } else if (strcmp(param, "server") == 0) {
+ target = SERVER;
+ } else if (strcmp(param, "client") == 0) {
+ target = CLIENT;
+ } else if (strcmp(param, "asset-path") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --asset-path" << endl;
+ error = true;
+ } else {
+ config.env.asset_path = argv[i];
+ }
+ } else if (strcmp(param, "host") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --host" << endl;
+ error = true;
+ } else {
+ config.client.host = argv[i];
+ }
+ } else if (strcmp(param, "port") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --port" << endl;
+ error = true;
+ } else {
+ config.server.port = strtoul(argv[i], nullptr, 10);
+ config.client.port = config.server.port;
+ }
+ } else if (strcmp(param, "player-name") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --player-name" << endl;
+ error = true;
+ } else {
+ config.interface.player_name = argv[i];
+ }
+ } else if (strcmp(param, "save-path") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --save-path" << endl;
+ error = true;
+ } else {
+ config.env.save_path = argv[i];
+ }
+ } else if (strcmp(param, "world-name") == 0) {
+ ++i;
+ if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
+ cerr << "missing argument to --world-name" << endl;
+ error = true;
+ } else {
+ config.world.name = argv[i];
+ }