diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-02 17:06:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-02 17:06:10 +0200 |
commit | 7c83b407648f1ef919218d8965d4c21378910755 (patch) | |
tree | 52f62723ccf07bb59a45737cb2d0fc89ae691f4f /cli/options.cxx | |
parent | 2eb28736a05c7083f2b30b501954a789bbd85f88 (diff) |
Add --generate-parse option
When specified, CLI will generate parse() functions instead of parsing
constructors. This is primarily useful for being able to parse into an
already initialized options class instance, for example, to implement
merging/overriding.
Diffstat (limited to 'cli/options.cxx')
-rw-r--r-- | cli/options.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/options.cxx b/cli/options.cxx index dcb408a..dd9d075 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -562,6 +562,7 @@ options () output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -625,6 +626,7 @@ options (int& argc, output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -691,6 +693,7 @@ options (int start, output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -757,6 +760,7 @@ options (int& argc, output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -825,6 +829,7 @@ options (int start, output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -889,6 +894,7 @@ options (::cli::scanner& s, output_dir_ (), generate_modifier_ (), generate_specifier_ (), + generate_parse_ (), generate_description_ (), generate_file_scanner_ (), suppress_inline_ (), @@ -960,6 +966,9 @@ print_usage (::std::ostream& os) os << "--generate-specifier Generate functions for determining whether the" << ::std::endl << " option was specified on the command line." << ::std::endl; + os << "--generate-parse Generate 'parse()' functions instead of parsing" << ::std::endl + << " constructors." << ::std::endl; + os << "--generate-description Generate the option description list that can be" << ::std::endl << " examined at runtime." << ::std::endl; @@ -1128,6 +1137,8 @@ struct _cli_options_map_init &::cli::thunk< options, bool, &options::generate_modifier_ >; _cli_options_map_["--generate-specifier"] = &::cli::thunk< options, bool, &options::generate_specifier_ >; + _cli_options_map_["--generate-parse"] = + &::cli::thunk< options, bool, &options::generate_parse_ >; _cli_options_map_["--generate-description"] = &::cli::thunk< options, bool, &options::generate_description_ >; _cli_options_map_["--generate-file-scanner"] = |