From: Henri Verbeet Subject: [PATCH vkd3d 5/5] vkd3d-compiler: Add a long option to specify the output file. Message-Id: <20200702134316.14971-5-hverbeet@codeweavers.com> Date: Thu, 2 Jul 2020 18:13:16 +0430 Signed-off-by: Henri Verbeet --- programs/vkd3d-compiler/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 1586b45..da03df2 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -32,6 +32,7 @@ enum { OPTION_HELP = CHAR_MAX + 1, + OPTION_OUTPUT, OPTION_STRIP_DEBUG, OPTION_VERSION, }; @@ -100,7 +101,7 @@ static void print_usage(const char *program_name) "[options...] file\n" "Options:\n" " -h, --help Display this information and exit.\n" - " -o Write the output to .\n" + " -o, --output= Write the output to .\n" " --strip-debug Strip debug information from the output.\n" " -V, --version Display version information and exit.\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[] = { - {"help", no_argument, NULL, OPTION_HELP}, - {"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG}, - {"version", no_argument, NULL, OPTION_VERSION}, - {NULL, 0, NULL, 0}, + {"help", no_argument, NULL, OPTION_HELP}, + {"output", required_argument, NULL, OPTION_OUTPUT}, + {"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG}, + {"version", no_argument, NULL, OPTION_VERSION}, + {NULL, 0, NULL, 0}, }; memset(options, 0, sizeof(*options)); @@ -168,6 +170,7 @@ static bool parse_command_line(int argc, char **argv, struct options *options) switch (option) { + case OPTION_OUTPUT: case 'o': options->output_filename = optarg; break; -- 2.11.0