CLIParser.h
branchv_0
changeset 6 fd93a46db15b
parent 5 ee4ba9f5a053
child 26 e7ceb915177e
equal deleted inserted replaced
5:ee4ba9f5a053 6:fd93a46db15b
    72 				tex.fileName = readNext(arguments, i);
    72 				tex.fileName = readNext(arguments, i);
    73 				c.textures.push_back(tex);
    73 				c.textures.push_back(tex);
    74 			} else if (option == OPTION_SHADER) {
    74 			} else if (option == OPTION_SHADER) {
    75 				const auto type = readNext(arguments, i);
    75 				const auto type = readNext(arguments, i);
    76 				const auto file = readNext(arguments, i);
    76 				const auto file = readNext(arguments, i);
    77 				if (type == "fragment") c.fragmentShaders.push_back({file});
    77 				c.shaders.push_back({file, type});
    78 				else if (type == "vertex") c.vertexShaders .push_back({file});
       
    79 				else throw std::invalid_argument("unsupported shader type");
       
    80 			} else if (option == OPTION_BACKGROUND_COLOR) {
    78 			} else if (option == OPTION_BACKGROUND_COLOR) {
    81 				c.backgroundColor = parseHexColor(readNext(arguments, i));
    79 				c.backgroundColor = parseHexColor(readNext(arguments, i));
    82 			} else if (option == OPTION_ROOT_WINDOW) {
    80 			} else if (option == OPTION_ROOT_WINDOW) {
    83 				c.rootWindow = std::stoul(readNext(arguments, i));
    81 				c.rootWindow = std::stoul(readNext(arguments, i));
    84 			} else throw std::logic_error("Unsupported CLI option: " + option);
    82 			} else throw std::logic_error("Unsupported CLI option: " + option);