|
68 | 68 | #include <math/vec3.h> |
69 | 69 | #include <math/vec4.h> |
70 | 70 |
|
71 | | -#include <getopt/getopt.h> |
| 71 | +#include <utils/getopt.h> |
72 | 72 |
|
73 | 73 | #include <algorithm> |
74 | 74 | #include <atomic> |
@@ -151,7 +151,7 @@ static void printUsage(char* name) { |
151 | 151 | " Prints this message\n\n" |
152 | 152 | "API_USAGE" |
153 | 153 | " --ibl=<path to cmgen IBL>, -i <path>\n" |
154 | | - " Applies an IBL generated by cmgen's deploy option\n\n" |
| 154 | + " Applies an IBL generated by cmgen's deploy utils::getopt::option\n\n" |
155 | 155 | " --scale=[number], -s [number]\n" |
156 | 156 | " Applies uniform scale\n\n" |
157 | 157 | " --material=<path>, -m <path>\n" |
@@ -186,25 +186,25 @@ static void printUsage(char* name) { |
186 | 186 | // Parses command line arguments and populates the Config object. |
187 | 187 | static int handleCommandLineArguments(int argc, char* argv[], Config* config) { |
188 | 188 | static constexpr const char* OPTSTR = "ha:s:li:m:c:p:x:yb:S:"; |
189 | | - static const struct option OPTIONS[] = { |
190 | | - { "help", no_argument, nullptr, 'h' }, |
191 | | - { "api", required_argument, nullptr, 'a' }, |
192 | | - { "ibl", required_argument, nullptr, 'i' }, |
193 | | - { "scale", required_argument, nullptr, 's' }, |
194 | | - { "material", required_argument, nullptr, 'm' }, |
195 | | - { "params", required_argument, nullptr, 'p' }, |
196 | | - { "count", required_argument, nullptr, 'c' }, |
197 | | - { "light-on", no_argument, nullptr, 'l' }, |
198 | | - { "skybox-off", no_argument, nullptr, 'y' }, |
199 | | - { "prefix", required_argument, nullptr, 'x' }, |
200 | | - { "clear-color", required_argument, nullptr, 'b' }, |
201 | | - { "size", required_argument, nullptr, 'S' }, |
202 | | - { nullptr, 0, nullptr, 0 } // termination of the option list |
| 189 | + static const utils::getopt::option OPTIONS[] = { |
| 190 | + { "help", utils::getopt::no_argument, nullptr, 'h' }, |
| 191 | + { "api", utils::getopt::required_argument, nullptr, 'a' }, |
| 192 | + { "ibl", utils::getopt::required_argument, nullptr, 'i' }, |
| 193 | + { "scale", utils::getopt::required_argument, nullptr, 's' }, |
| 194 | + { "material", utils::getopt::required_argument, nullptr, 'm' }, |
| 195 | + { "params", utils::getopt::required_argument, nullptr, 'p' }, |
| 196 | + { "count", utils::getopt::required_argument, nullptr, 'c' }, |
| 197 | + { "light-on", utils::getopt::no_argument, nullptr, 'l' }, |
| 198 | + { "skybox-off", utils::getopt::no_argument, nullptr, 'y' }, |
| 199 | + { "prefix", utils::getopt::required_argument, nullptr, 'x' }, |
| 200 | + { "clear-color", utils::getopt::required_argument, nullptr, 'b' }, |
| 201 | + { "size", utils::getopt::required_argument, nullptr, 'S' }, |
| 202 | + { nullptr, 0, nullptr, 0 } // termination of the utils::getopt::option list |
203 | 203 | }; |
204 | 204 | int opt; |
205 | 205 | int option_index = 0; |
206 | | - while ((opt = getopt_long(argc, argv, OPTSTR, OPTIONS, &option_index)) >= 0) { |
207 | | - std::string const arg(optarg ? optarg : ""); |
| 206 | + while ((opt = utils::getopt::getopt_long(argc, argv, OPTSTR, OPTIONS, &option_index)) >= 0) { |
| 207 | + std::string const arg(utils::getopt::optarg ? utils::getopt::optarg : ""); |
208 | 208 | switch (opt) { |
209 | 209 | default: |
210 | 210 | case 'h': |
@@ -272,7 +272,7 @@ static int handleCommandLineArguments(int argc, char* argv[], Config* config) { |
272 | 272 | } |
273 | 273 | } |
274 | 274 |
|
275 | | - return optind; |
| 275 | + return utils::getopt::optind; |
276 | 276 | } |
277 | 277 |
|
278 | 278 | // Cleans up Filament resources (entities, materials, etc.) before exit. |
|
0 commit comments