From f78525ab41e2aa219199119c0f9f7ffcc8dbddeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Tue, 26 Feb 2019 17:49:11 +0100 Subject: [PATCH] Fix cxxopts error --- tool/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tool/main.cpp b/tool/main.cpp index cf96d37..fe3bba6 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -188,17 +188,17 @@ std::unique_ptr parse_file(const cppast::libclang_compile_conf int main(int argc, char* argv[]) try { - cxxopts::Options options("cppast", - "cppast - The commandline interface to the cppast library.\n"); + cxxopts::Options option_list("cppast", + "cppast - The commandline interface to the cppast library.\n"); // clang-format off - options.add_options() + option_list.add_options() ("h,help", "display this help and exit") ("version", "display version information and exit") ("v,verbose", "be verbose when parsing") ("fatal_errors", "abort program when a parser error occurs, instead of doing error correction") ("file", "the file that is being parsed (last positional argument)", cxxopts::value()); - options.add_options("compilation") + option_list.add_options("compilation") ("database_dir", "set the directory where a 'compile_commands.json' file is located containing build information", cxxopts::value()) ("database_file", "set the file name whose configuration will be used regardless of the current file name", @@ -219,11 +219,11 @@ int main(int argc, char* argv[]) try ("fast_preprocessing", "enable fast preprocessing, be careful, this breaks if you e.g. redefine macros in the same file!") ("remove_comments_in_macro", "whether or not comments generated by macro are kept, enable if you run into errors"); // clang-format on - options.parse_positional("file"); - options.parse(argc, argv); + option_list.parse_positional("file"); + auto options = option_list.parse(argc, argv); if (options.count("help")) - print_help(options); + print_help(option_list); else if (options.count("version")) { std::cout << "cppast version " << CPPAST_VERSION_STRING << "\n";