summaryrefslogtreecommitdiff
path: root/cli/options.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-09 18:02:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-09 18:02:40 +0200
commit9bf40e4a91f6a792c3279d9184b67451cf58bf49 (patch)
treea242a923ec7d309dc488c60f1233fbc91fcbae70 /cli/options.cxx
parentbd21176187a55fa7f6e80b5cfe86f5e756971b4f (diff)
Add --std option with c++{98,11,14} values; use function-static in C++11
This way we can use option descriptions during static initialization (e.g., of an Apache module).
Diffstat (limited to 'cli/options.cxx')
-rw-r--r--cli/options.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/options.cxx b/cli/options.cxx
index 95f2a6c..3e7dbcc 100644
--- a/cli/options.cxx
+++ b/cli/options.cxx
@@ -567,6 +567,8 @@ options ()
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -676,6 +678,8 @@ options (int& argc,
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -788,6 +792,8 @@ options (int start,
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -900,6 +906,8 @@ options (int& argc,
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -1014,6 +1022,8 @@ options (int start,
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -1124,6 +1134,8 @@ options (::cli::scanner& s,
include_path_specified_ (false),
output_dir_ (),
output_dir_specified_ (false),
+ std_ (cxx_version::cxx98),
+ std_specified_ (false),
generate_modifier_ (),
generate_specifier_ (),
generate_parse_ (),
@@ -1240,6 +1252,9 @@ print_usage (::std::ostream& os, ::cli::usage_para p)
os << "--output-dir|-o <dir> Write the generated files to <dir> instead of the" << ::std::endl
<< " current directory." << ::std::endl;
+ os << "--std <version> Specify the C++ standard that should be used" << ::std::endl
+ << " during compilation." << ::std::endl;
+
os << "--generate-modifier Generate option value modifiers in addition to" << ::std::endl
<< " accessors." << ::std::endl;
@@ -1436,6 +1451,9 @@ struct _cli_options_map_init
_cli_options_map_["-o"] =
&::cli::thunk< options, std::string, &options::output_dir_,
&options::output_dir_specified_ >;
+ _cli_options_map_["--std"] =
+ &::cli::thunk< options, cxx_version, &options::std_,
+ &options::std_specified_ >;
_cli_options_map_["--generate-modifier"] =
&::cli::thunk< options, bool, &options::generate_modifier_ >;
_cli_options_map_["--generate-specifier"] =