vkd3d-compiler: Add a long option to specify the output file.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-07-02 18:13:16 +04:30 committed by Alexandre Julliard
parent 4a094f5cba
commit 7bcddce05c

View File

@ -32,6 +32,7 @@
enum enum
{ {
OPTION_HELP = CHAR_MAX + 1, OPTION_HELP = CHAR_MAX + 1,
OPTION_OUTPUT,
OPTION_STRIP_DEBUG, OPTION_STRIP_DEBUG,
OPTION_VERSION, OPTION_VERSION,
}; };
@ -100,7 +101,7 @@ static void print_usage(const char *program_name)
"[options...] file\n" "[options...] file\n"
"Options:\n" "Options:\n"
" -h, --help Display this information and exit.\n" " -h, --help Display this information and exit.\n"
" -o <file> Write the output to <file>.\n" " -o, --output=<file> Write the output to <file>.\n"
" --strip-debug Strip debug information from the output.\n" " --strip-debug Strip debug information from the output.\n"
" -V, --version Display version information and exit.\n" " -V, --version Display version information and exit.\n"
" -- Stop option processing. Any subsequent argument is\n" " -- Stop option processing. Any subsequent argument is\n"
@ -153,10 +154,11 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
static struct option long_options[] = static struct option long_options[] =
{ {
{"help", no_argument, NULL, OPTION_HELP}, {"help", no_argument, NULL, OPTION_HELP},
{"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG}, {"output", required_argument, NULL, OPTION_OUTPUT},
{"version", no_argument, NULL, OPTION_VERSION}, {"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG},
{NULL, 0, NULL, 0}, {"version", no_argument, NULL, OPTION_VERSION},
{NULL, 0, NULL, 0},
}; };
memset(options, 0, sizeof(*options)); memset(options, 0, sizeof(*options));
@ -168,6 +170,7 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
switch (option) switch (option)
{ {
case OPTION_OUTPUT:
case 'o': case 'o':
options->output_filename = optarg; options->output_filename = optarg;
break; break;