From 9898d667145c800dab0d185d5c29d4bd2c0408a1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 31 Aug 2022 23:00:12 +0300 Subject: Make build graph configuration-independent --- cli/build/root.build | 4 +- cli/cli/.gitignore | 2 +- cli/cli/bootstrap/cli/options.cxx | 2258 -------------------------------- cli/cli/bootstrap/cli/options.hxx | 1700 ------------------------ cli/cli/bootstrap/cli/options.ixx | 2400 ---------------------------------- cli/cli/buildfile | 143 +- cli/cli/pregenerated/cli/options.cxx | 2258 ++++++++++++++++++++++++++++++++ cli/cli/pregenerated/cli/options.hxx | 1700 ++++++++++++++++++++++++ cli/cli/pregenerated/cli/options.ixx | 2400 ++++++++++++++++++++++++++++++++++ cli/doc/bootstrap/cli.1 | 423 ------ cli/doc/bootstrap/cli.xhtml | 584 --------- cli/doc/buildfile | 231 ++-- cli/doc/pregenerated/cli.1 | 423 ++++++ cli/doc/pregenerated/cli.xhtml | 584 +++++++++ 14 files changed, 7608 insertions(+), 7502 deletions(-) delete mode 100644 cli/cli/bootstrap/cli/options.cxx delete mode 100644 cli/cli/bootstrap/cli/options.hxx delete mode 100644 cli/cli/bootstrap/cli/options.ixx create mode 100644 cli/cli/pregenerated/cli/options.cxx create mode 100644 cli/cli/pregenerated/cli/options.hxx create mode 100644 cli/cli/pregenerated/cli/options.ixx delete mode 100644 cli/doc/bootstrap/cli.1 delete mode 100644 cli/doc/bootstrap/cli.xhtml create mode 100644 cli/doc/pregenerated/cli.1 create mode 100644 cli/doc/pregenerated/cli.xhtml (limited to 'cli') diff --git a/cli/build/root.build b/cli/build/root.build index 0753a9e..ceeaf6c 100644 --- a/cli/build/root.build +++ b/cli/build/root.build @@ -4,10 +4,12 @@ # Note that we cannot install the development build. This is due to both the # bootstrap cli (which we need to run) and the final cli (which we need to # install) depending on libcutl (so we need it to be both "for-install" and -# "for-run"). Nor can we run the final cli to generate the man pages. +# "for-run"). Nor can we run such final cli to generate the man pages. # config [bool] config.cli.develop ?= false +develop = $config.cli.develop + define cli: file cli{*}: extension = cli diff --git a/cli/cli/.gitignore b/cli/cli/.gitignore index 79562f1..614e56f 100644 --- a/cli/cli/.gitignore +++ b/cli/cli/.gitignore @@ -1,5 +1,5 @@ /cli -/bootstrap/cli/cli +/pregenerated/cli/cli /version.hxx /options.?xx diff --git a/cli/cli/bootstrap/cli/options.cxx b/cli/cli/bootstrap/cli/options.cxx deleted file mode 100644 index 2cb2f75..0000000 --- a/cli/cli/bootstrap/cli/options.cxx +++ /dev/null @@ -1,2258 +0,0 @@ -// -*- C++ -*- -// -// This file was generated by CLI, a command line interface -// compiler for C++. -// - -// Begin prologue. -// -// -// End prologue. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cli -{ - // unknown_option - // - unknown_option:: - ~unknown_option () throw () - { - } - - void unknown_option:: - print (::std::ostream& os) const - { - os << "unknown option '" << option ().c_str () << "'"; - } - - const char* unknown_option:: - what () const throw () - { - return "unknown option"; - } - - // unknown_argument - // - unknown_argument:: - ~unknown_argument () throw () - { - } - - void unknown_argument:: - print (::std::ostream& os) const - { - os << "unknown argument '" << argument ().c_str () << "'"; - } - - const char* unknown_argument:: - what () const throw () - { - return "unknown argument"; - } - - // missing_value - // - missing_value:: - ~missing_value () throw () - { - } - - void missing_value:: - print (::std::ostream& os) const - { - os << "missing value for option '" << option ().c_str () << "'"; - } - - const char* missing_value:: - what () const throw () - { - return "missing option value"; - } - - // invalid_value - // - invalid_value:: - ~invalid_value () throw () - { - } - - void invalid_value:: - print (::std::ostream& os) const - { - os << "invalid value '" << value ().c_str () << "' for option '" - << option ().c_str () << "'"; - - if (!message ().empty ()) - os << ": " << message ().c_str (); - } - - const char* invalid_value:: - what () const throw () - { - return "invalid option value"; - } - - // eos_reached - // - void eos_reached:: - print (::std::ostream& os) const - { - os << what (); - } - - const char* eos_reached:: - what () const throw () - { - return "end of argument stream reached"; - } - - // file_io_failure - // - file_io_failure:: - ~file_io_failure () throw () - { - } - - void file_io_failure:: - print (::std::ostream& os) const - { - os << "unable to open file '" << file ().c_str () << "' or read failure"; - } - - const char* file_io_failure:: - what () const throw () - { - return "unable to open file or read failure"; - } - - // unmatched_quote - // - unmatched_quote:: - ~unmatched_quote () throw () - { - } - - void unmatched_quote:: - print (::std::ostream& os) const - { - os << "unmatched quote in argument '" << argument ().c_str () << "'"; - } - - const char* unmatched_quote:: - what () const throw () - { - return "unmatched quote"; - } - - // scanner - // - scanner:: - ~scanner () - { - } - - // argv_scanner - // - bool argv_scanner:: - more () - { - return i_ < argc_; - } - - const char* argv_scanner:: - peek () - { - if (i_ < argc_) - return argv_[i_]; - else - throw eos_reached (); - } - - const char* argv_scanner:: - next () - { - if (i_ < argc_) - { - const char* r (argv_[i_]); - - if (erase_) - { - for (int i (i_ + 1); i < argc_; ++i) - argv_[i - 1] = argv_[i]; - - --argc_; - argv_[argc_] = 0; - } - else - ++i_; - - ++start_position_; - return r; - } - else - throw eos_reached (); - } - - void argv_scanner:: - skip () - { - if (i_ < argc_) - { - ++i_; - ++start_position_; - } - else - throw eos_reached (); - } - - std::size_t argv_scanner:: - position () - { - return start_position_; - } - - // argv_file_scanner - // - int argv_file_scanner::zero_argc_ = 0; - std::string argv_file_scanner::empty_string_; - - bool argv_file_scanner:: - more () - { - if (!args_.empty ()) - return true; - - while (base::more ()) - { - // See if the next argument is the file option. - // - const char* a (base::peek ()); - const option_info* oi = 0; - const char* ov = 0; - - if (!skip_) - { - if ((oi = find (a)) != 0) - { - base::next (); - - if (!base::more ()) - throw missing_value (a); - - ov = base::next (); - } - else if (std::strncmp (a, "-", 1) == 0) - { - if ((ov = std::strchr (a, '=')) != 0) - { - std::string o (a, 0, ov - a); - if ((oi = find (o.c_str ())) != 0) - { - base::next (); - ++ov; - } - } - } - } - - if (oi != 0) - { - if (oi->search_func != 0) - { - std::string f (oi->search_func (ov, oi->arg)); - - if (!f.empty ()) - load (f); - } - else - load (ov); - - if (!args_.empty ()) - return true; - } - else - { - if (!skip_) - skip_ = (std::strcmp (a, "--") == 0); - - return true; - } - } - - return false; - } - - const char* argv_file_scanner:: - peek () - { - if (!more ()) - throw eos_reached (); - - return args_.empty () ? base::peek () : args_.front ().value.c_str (); - } - - const std::string& argv_file_scanner:: - peek_file () - { - if (!more ()) - throw eos_reached (); - - return args_.empty () ? empty_string_ : *args_.front ().file; - } - - std::size_t argv_file_scanner:: - peek_line () - { - if (!more ()) - throw eos_reached (); - - return args_.empty () ? 0 : args_.front ().line; - } - - const char* argv_file_scanner:: - next () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::next (); - else - { - hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ().value); - args_.pop_front (); - ++start_position_; - return hold_[i_].c_str (); - } - } - - void argv_file_scanner:: - skip () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::skip (); - else - { - args_.pop_front (); - ++start_position_; - } - } - - const argv_file_scanner::option_info* argv_file_scanner:: - find (const char* a) const - { - for (std::size_t i (0); i < options_count_; ++i) - if (std::strcmp (a, options_[i].option) == 0) - return &options_[i]; - - return 0; - } - - std::size_t argv_file_scanner:: - position () - { - return start_position_; - } - - void argv_file_scanner:: - load (const std::string& file) - { - using namespace std; - - ifstream is (file.c_str ()); - - if (!is.is_open ()) - throw file_io_failure (file); - - files_.push_back (file); - - arg a; - a.file = &*files_.rbegin (); - - for (a.line = 1; !is.eof (); ++a.line) - { - string line; - getline (is, line); - - if (is.fail () && !is.eof ()) - throw file_io_failure (file); - - string::size_type n (line.size ()); - - // Trim the line from leading and trailing whitespaces. - // - if (n != 0) - { - const char* f (line.c_str ()); - const char* l (f + n); - - const char* of (f); - while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) - ++f; - - --l; - - const char* ol (l); - while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) - --l; - - if (f != of || l != ol) - line = f <= l ? string (f, l - f + 1) : string (); - } - - // Ignore empty lines, those that start with #. - // - if (line.empty () || line[0] == '#') - continue; - - string::size_type p (string::npos); - if (line.compare (0, 1, "-") == 0) - { - p = line.find (' '); - - string::size_type q (line.find ('=')); - if (q != string::npos && q < p) - p = q; - } - - string s1; - if (p != string::npos) - { - s1.assign (line, 0, p); - - // Skip leading whitespaces in the argument. - // - if (line[p] == '=') - ++p; - else - { - n = line.size (); - for (++p; p < n; ++p) - { - char c (line[p]); - if (c != ' ' && c != '\t' && c != '\r') - break; - } - } - } - else if (!skip_) - skip_ = (line == "--"); - - string s2 (line, p != string::npos ? p : 0); - - // If the string (which is an option value or argument) is - // wrapped in quotes, remove them. - // - n = s2.size (); - char cf (s2[0]), cl (s2[n - 1]); - - if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') - { - if (n == 1 || cf != cl) - throw unmatched_quote (s2); - - s2 = string (s2, 1, n - 2); - } - - if (!s1.empty ()) - { - // See if this is another file option. - // - const option_info* oi; - if (!skip_ && (oi = find (s1.c_str ()))) - { - if (s2.empty ()) - throw missing_value (oi->option); - - if (oi->search_func != 0) - { - string f (oi->search_func (s2.c_str (), oi->arg)); - if (!f.empty ()) - load (f); - } - else - { - // If the path of the file being parsed is not simple and the - // path of the file that needs to be loaded is relative, then - // complete the latter using the former as a base. - // -#ifndef _WIN32 - string::size_type p (file.find_last_of ('/')); - bool c (p != string::npos && s2[0] != '/'); -#else - string::size_type p (file.find_last_of ("/\\")); - bool c (p != string::npos && s2[1] != ':'); -#endif - if (c) - s2.insert (0, file, 0, p + 1); - - load (s2); - } - - continue; - } - - a.value = s1; - args_.push_back (a); - } - - a.value = s2; - args_.push_back (a); - } - } - - template - struct parser - { - static void - parse (X& x, bool& xs, scanner& s) - { - using namespace std; - - const char* o (s.next ()); - if (s.more ()) - { - string v (s.next ()); - istringstream is (v); - if (!(is >> x && is.peek () == istringstream::traits_type::eof ())) - throw invalid_value (o, v); - } - else - throw missing_value (o); - - xs = true; - } - }; - - template <> - struct parser - { - static void - parse (bool& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - const char* v (s.next ()); - - if (std::strcmp (v, "1") == 0 || - std::strcmp (v, "true") == 0 || - std::strcmp (v, "TRUE") == 0 || - std::strcmp (v, "True") == 0) - x = true; - else if (std::strcmp (v, "0") == 0 || - std::strcmp (v, "false") == 0 || - std::strcmp (v, "FALSE") == 0 || - std::strcmp (v, "False") == 0) - x = false; - else - throw invalid_value (o, v); - } - else - throw missing_value (o); - - xs = true; - } - }; - - template <> - struct parser - { - static void - parse (std::string& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - x = s.next (); - else - throw missing_value (o); - - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::pair& x, bool& xs, scanner& s) - { - x.second = s.position (); - parser::parse (x.first, xs, s); - } - }; - - template - struct parser > - { - static void - parse (std::vector& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.push_back (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::set& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.insert (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::map& m, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - std::size_t pos (s.position ()); - std::string ov (s.next ()); - std::string::size_type p = ov.find ('='); - - K k = K (); - V v = V (); - std::string kstr (ov, 0, p); - std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); - - int ac (2); - char* av[] = - { - const_cast (o), - 0 - }; - - bool dummy; - if (!kstr.empty ()) - { - av[1] = const_cast (kstr.c_str ()); - argv_scanner s (0, ac, av, false, pos); - parser::parse (k, dummy, s); - } - - if (!vstr.empty ()) - { - av[1] = const_cast (vstr.c_str ()); - argv_scanner s (0, ac, av, false, pos); - parser::parse (v, dummy, s); - } - - m[k] = v; - } - else - throw missing_value (o); - - xs = true; - } - }; - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, s); - } - - template - void - thunk (X& x, scanner& s) - { - s.next (); - x.*M = true; - } - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, x.*S, s); - } -} - -#include - -// options -// - -options:: -options () -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ -} - -options:: -options (int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); -} - -options:: -options (int start, - int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); -} - -options:: -options (int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); -} - -options:: -options (int start, - int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); -} - -options:: -options (::cli::scanner& s, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) -: build2_metadata_ (), - build2_metadata_specified_ (false), - help_ (), - version_ (), - include_path_ (), - include_path_specified_ (false), - output_dir_ (), - output_dir_specified_ (false), - std_ (cxx_version::cxx98), - std_specified_ (false), - generate_modifier_ (), - generate_specifier_ (), - generate_parse_ (), - generate_merge_ (), - generate_description_ (), - generate_file_scanner_ (), - generate_vector_scanner_ (), - generate_group_scanner_ (), - suppress_inline_ (), - suppress_cli_ (), - cli_namespace_ ("::cli"), - cli_namespace_specified_ (false), - ostream_type_ ("::std::ostream"), - ostream_type_specified_ (false), - export_symbol_ (), - export_symbol_specified_ (false), - generate_cxx_ (), - generate_man_ (), - generate_html_ (), - generate_txt_ (), - stdout__ (), - suppress_undocumented_ (), - suppress_usage_ (), - long_usage_ (), - short_usage_ (), - page_usage_ (), - page_usage_specified_ (false), - option_length_ (0), - option_length_specified_ (false), - ascii_tree_ (), - ansi_color_ (), - exclude_base_ (), - include_base_last_ (), - class_doc_ (), - class_doc_specified_ (false), - class__ (), - class__specified_ (false), - docvar_ (), - docvar_specified_ (false), - link_regex_ (), - link_regex_specified_ (false), - link_regex_trace_ (), - html_heading_map_ (), - html_heading_map_specified_ (false), - omit_link_check_ (), - hxx_prologue_ (), - hxx_prologue_specified_ (false), - ixx_prologue_ (), - ixx_prologue_specified_ (false), - cxx_prologue_ (), - cxx_prologue_specified_ (false), - man_prologue_ (), - man_prologue_specified_ (false), - html_prologue_ (), - html_prologue_specified_ (false), - txt_prologue_ (), - txt_prologue_specified_ (false), - hxx_epilogue_ (), - hxx_epilogue_specified_ (false), - ixx_epilogue_ (), - ixx_epilogue_specified_ (false), - cxx_epilogue_ (), - cxx_epilogue_specified_ (false), - man_epilogue_ (), - man_epilogue_specified_ (false), - html_epilogue_ (), - html_epilogue_specified_ (false), - txt_epilogue_ (), - txt_epilogue_specified_ (false), - hxx_prologue_file_ (), - hxx_prologue_file_specified_ (false), - ixx_prologue_file_ (), - ixx_prologue_file_specified_ (false), - cxx_prologue_file_ (), - cxx_prologue_file_specified_ (false), - man_prologue_file_ (), - man_prologue_file_specified_ (false), - html_prologue_file_ (), - html_prologue_file_specified_ (false), - txt_prologue_file_ (), - txt_prologue_file_specified_ (false), - hxx_epilogue_file_ (), - hxx_epilogue_file_specified_ (false), - ixx_epilogue_file_ (), - ixx_epilogue_file_specified_ (false), - cxx_epilogue_file_ (), - cxx_epilogue_file_specified_ (false), - man_epilogue_file_ (), - man_epilogue_file_specified_ (false), - html_epilogue_file_ (), - html_epilogue_file_specified_ (false), - txt_epilogue_file_ (), - txt_epilogue_file_specified_ (false), - output_prefix_ (), - output_prefix_specified_ (false), - output_suffix_ (), - output_suffix_specified_ (false), - hxx_suffix_ (".hxx"), - hxx_suffix_specified_ (false), - ixx_suffix_ (".ixx"), - ixx_suffix_specified_ (false), - cxx_suffix_ (".cxx"), - cxx_suffix_specified_ (false), - man_suffix_ (".1"), - man_suffix_specified_ (false), - html_suffix_ (".html"), - html_suffix_specified_ (false), - txt_suffix_ (".txt"), - txt_suffix_specified_ (false), - option_prefix_ ("-"), - option_prefix_specified_ (false), - option_separator_ ("--"), - option_separator_specified_ (false), - keep_separator_ (), - no_combined_flags_ (), - no_combined_values_ (), - include_with_brackets_ (), - include_prefix_ (), - include_prefix_specified_ (false), - guard_prefix_ (), - guard_prefix_specified_ (false), - reserved_name_ (), - reserved_name_specified_ (false), - options_file_ (), - options_file_specified_ (false) -{ - _parse (s, opt, arg); -} - -::cli::usage_para options:: -print_usage (::std::ostream& os, ::cli::usage_para p) -{ - CLI_POTENTIALLY_UNUSED (os); - - if (p == ::cli::usage_para::text) - os << ::std::endl; - - os << "--help Print usage information and exit." << ::std::endl; - - os << "--version Print version and exit." << ::std::endl; - - os << "--include-path|-I Search for bracket-included (<>) options" << ::std::endl - << " files." << ::std::endl; - - os << "--output-dir|-o Write the generated files to instead of the" << ::std::endl - << " current directory." << ::std::endl; - - os << "--std 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; - - 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-merge Generate merge() functions." << ::std::endl; - - os << "--generate-description Generate the option description list that can be" << ::std::endl - << " examined at runtime." << ::std::endl; - - os << "--generate-file-scanner Generate the argv_file_scanner implementation." << ::std::endl; - - os << "--generate-vector-scanner Generate the vector_scanner implementation." << ::std::endl; - - os << "--generate-group-scanner Generate the group_scanner implementation." << ::std::endl; - - os << "--suppress-inline Generate all functions non-inline." << ::std::endl; - - os << "--suppress-cli Do not generate the CLI support types (scanners," << ::std::endl - << " parser, etc)." << ::std::endl; - - os << "--cli-namespace Generate the CLI support types in the " << ::std::endl - << " namespace (cli by default)." << ::std::endl; - - os << "--ostream-type Output stream type instead of the default" << ::std::endl - << " std::ostream that should be used to print usage" << ::std::endl - << " and exception information." << ::std::endl; - - os << "--export-symbol Insert in places where DLL export/import" << ::std::endl - << " control statements" << ::std::endl - << " (__declspec(dllexport/dllimport)) are necessary." << ::std::endl; - - os << "--generate-cxx Generate C++ code." << ::std::endl; - - os << "--generate-man Generate documentation in the man page format." << ::std::endl; - - os << "--generate-html Generate documentation in the HTML format." << ::std::endl; - - os << "--generate-txt Generate documentation in the plain text format," << ::std::endl - << " similar to usage." << ::std::endl; - - os << "--stdout Write output to STDOUT instead of a file." << ::std::endl; - - os << "--suppress-undocumented Suppress the generation of documentation entries" << ::std::endl - << " for undocumented options." << ::std::endl; - - os << "--suppress-usage Suppress the generation of the usage printing" << ::std::endl - << " code." << ::std::endl; - - os << "--long-usage If no short documentation string is provided, use" << ::std::endl - << " the complete long documentation string in usage." << ::std::endl; - - os << "--short-usage If specified together with --long-usage, generate" << ::std::endl - << " both short and long usage versions." << ::std::endl; - - os << "--page-usage Generate the combined usage printing code for the" << ::std::endl - << " entire page." << ::std::endl; - - os << "--option-length Indent option descriptions characters when" << ::std::endl - << " printing usage." << ::std::endl; - - os << "--ascii-tree Convert UTF-8 tree(1) output to ASCII." << ::std::endl; - - os << "--ansi-color Use ANSI color escape sequences when printing" << ::std::endl - << " usage." << ::std::endl; - - os << "--exclude-base Exclude base class information from usage and" << ::std::endl - << " documentation." << ::std::endl; - - os << "--include-base-last Include base class information after derived for" << ::std::endl - << " usage and documentation." << ::std::endl; - - os << "--class-doc = Specify the documentation that should be" << ::std::endl - << " used for the options class ." << ::std::endl; - - os << "--class Generate the man page, HTML, or text documentation" << ::std::endl - << " only for the options class ." << ::std::endl; - - os << "--docvar|-v = Set documentation variable to the value" << ::std::endl - << " ." << ::std::endl; - - os << "--link-regex Add to the list of regular expressions" << ::std::endl - << " used to transform link targets in the generated" << ::std::endl - << " documentation." << ::std::endl; - - os << "--link-regex-trace Trace the process of applying regular expressions" << ::std::endl - << " specified with the --link-regex option." << ::std::endl; - - os << "--html-heading-map = Map CLI heading (valid values: 'H', '0', '1'," << ::std::endl - << " 'h', and '2') to HTML heading (for example," << ::std::endl - << " 'h1', 'h2', etc)." << ::std::endl; - - os << "--omit-link-check Don't check that local fragment link references" << ::std::endl - << " (\\l{#ref ...}) resolve to ids." << ::std::endl; - - os << "--hxx-prologue Insert at the beginning of the generated" << ::std::endl - << " C++ header file." << ::std::endl; - - os << "--ixx-prologue Insert at the beginning of the generated" << ::std::endl - << " C++ inline file." << ::std::endl; - - os << "--cxx-prologue Insert at the beginning of the generated" << ::std::endl - << " C++ source file." << ::std::endl; - - os << "--man-prologue Insert at the beginning of the generated" << ::std::endl - << " man page file." << ::std::endl; - - os << "--html-prologue Insert at the beginning of the generated" << ::std::endl - << " HTML file." << ::std::endl; - - os << "--txt-prologue Insert at the beginning of the generated" << ::std::endl - << " text file." << ::std::endl; - - os << "--hxx-epilogue Insert at the end of the generated C++" << ::std::endl - << " header file." << ::std::endl; - - os << "--ixx-epilogue Insert at the end of the generated C++" << ::std::endl - << " inline file." << ::std::endl; - - os << "--cxx-epilogue Insert at the end of the generated C++" << ::std::endl - << " source file." << ::std::endl; - - os << "--man-epilogue Insert at the end of the generated man page" << ::std::endl - << " file." << ::std::endl; - - os << "--html-epilogue Insert at the end of the generated HTML" << ::std::endl - << " file." << ::std::endl; - - os << "--txt-epilogue Insert at the end of the generated text" << ::std::endl - << " file." << ::std::endl; - - os << "--hxx-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated C++ header file." << ::std::endl; - - os << "--ixx-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated C++ inline file." << ::std::endl; - - os << "--cxx-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated C++ source file." << ::std::endl; - - os << "--man-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated man page file." << ::std::endl; - - os << "--html-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated HTML file." << ::std::endl; - - os << "--txt-prologue-file Insert the content of at the beginning of" << ::std::endl - << " the generated text file." << ::std::endl; - - os << "--hxx-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated C++ header file." << ::std::endl; - - os << "--ixx-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated C++ inline file." << ::std::endl; - - os << "--cxx-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated C++ source file." << ::std::endl; - - os << "--man-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated man page file." << ::std::endl; - - os << "--html-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated HTML file." << ::std::endl; - - os << "--txt-epilogue-file Insert the content of at the end of the" << ::std::endl - << " generated text file." << ::std::endl; - - os << "--output-prefix Add at the beginning of the generated" << ::std::endl - << " output file name(s)." << ::std::endl; - - os << "--output-suffix Add at the end of the generated output" << ::std::endl - << " file name(s)." << ::std::endl; - - os << "--hxx-suffix Use instead of the default .hxx to" << ::std::endl - << " construct the name of the generated header file." << ::std::endl; - - os << "--ixx-suffix Use instead of the default .ixx to" << ::std::endl - << " construct the name of the generated inline file." << ::std::endl; - - os << "--cxx-suffix Use instead of the default .cxx to" << ::std::endl - << " construct the name of the generated source file." << ::std::endl; - - os << "--man-suffix Use instead of the default .1 to" << ::std::endl - << " construct the name of the generated man page file." << ::std::endl; - - os << "--html-suffix Use instead of the default .html to" << ::std::endl - << " construct the name of the generated HTML file." << ::std::endl; - - os << "--txt-suffix Use instead of the default .txt to" << ::std::endl - << " construct the name of the generated text file." << ::std::endl; - - os << "--option-prefix Use instead of the default '-' as an" << ::std::endl - << " option prefix." << ::std::endl; - - os << "--option-separator Use instead of the default '--' as an" << ::std::endl - << " optional separator between options and arguments." << ::std::endl; - - os << "--keep-separator Leave the option separator in the scanner." << ::std::endl; - - os << "--no-combined-flags Disable support for combining multiple" << ::std::endl - << " single-character flags into a single argument (the" << ::std::endl - << " -xyz form that is equivalent to -x -y -z)." << ::std::endl; - - os << "--no-combined-values Disable support for combining an option and its" << ::std::endl - << " value into a single argument with the assignment" << ::std::endl - << " sign (the option=value form)." << ::std::endl; - - os << "--include-with-brackets Use angle brackets (<>) instead of quotes (\"\") in" << ::std::endl - << " the generated #include directives." << ::std::endl; - - os << "--include-prefix Add to the generated #include directive" << ::std::endl - << " paths." << ::std::endl; - - os << "--guard-prefix Add to the generated header inclusion" << ::std::endl - << " guards." << ::std::endl; - - os << "--reserved-name = Add with an optional replacement to" << ::std::endl - << " the list of names that should not be used as" << ::std::endl - << " identifiers." << ::std::endl; - - os << "--options-file Read additional options from ." << ::std::endl; - - p = ::cli::usage_para::option; - - return p; -} - -typedef -std::map -_cli_options_map; - -static _cli_options_map _cli_options_map_; - -struct _cli_options_map_init -{ - _cli_options_map_init () - { - _cli_options_map_["--build2-metadata"] = - &::cli::thunk< options, std::uint64_t, &options::build2_metadata_, - &options::build2_metadata_specified_ >; - _cli_options_map_["--help"] = - &::cli::thunk< options, &options::help_ >; - _cli_options_map_["--version"] = - &::cli::thunk< options, &options::version_ >; - _cli_options_map_["--include-path"] = - &::cli::thunk< options, std::vector, &options::include_path_, - &options::include_path_specified_ >; - _cli_options_map_["-I"] = - &::cli::thunk< options, std::vector, &options::include_path_, - &options::include_path_specified_ >; - _cli_options_map_["--output-dir"] = - &::cli::thunk< options, std::string, &options::output_dir_, - &options::output_dir_specified_ >; - _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, &options::generate_modifier_ >; - _cli_options_map_["--generate-specifier"] = - &::cli::thunk< options, &options::generate_specifier_ >; - _cli_options_map_["--generate-parse"] = - &::cli::thunk< options, &options::generate_parse_ >; - _cli_options_map_["--generate-merge"] = - &::cli::thunk< options, &options::generate_merge_ >; - _cli_options_map_["--generate-description"] = - &::cli::thunk< options, &options::generate_description_ >; - _cli_options_map_["--generate-file-scanner"] = - &::cli::thunk< options, &options::generate_file_scanner_ >; - _cli_options_map_["--generate-vector-scanner"] = - &::cli::thunk< options, &options::generate_vector_scanner_ >; - _cli_options_map_["--generate-group-scanner"] = - &::cli::thunk< options, &options::generate_group_scanner_ >; - _cli_options_map_["--suppress-inline"] = - &::cli::thunk< options, &options::suppress_inline_ >; - _cli_options_map_["--suppress-cli"] = - &::cli::thunk< options, &options::suppress_cli_ >; - _cli_options_map_["--cli-namespace"] = - &::cli::thunk< options, std::string, &options::cli_namespace_, - &options::cli_namespace_specified_ >; - _cli_options_map_["--ostream-type"] = - &::cli::thunk< options, std::string, &options::ostream_type_, - &options::ostream_type_specified_ >; - _cli_options_map_["--export-symbol"] = - &::cli::thunk< options, std::string, &options::export_symbol_, - &options::export_symbol_specified_ >; - _cli_options_map_["--generate-cxx"] = - &::cli::thunk< options, &options::generate_cxx_ >; - _cli_options_map_["--generate-man"] = - &::cli::thunk< options, &options::generate_man_ >; - _cli_options_map_["--generate-html"] = - &::cli::thunk< options, &options::generate_html_ >; - _cli_options_map_["--generate-txt"] = - &::cli::thunk< options, &options::generate_txt_ >; - _cli_options_map_["--stdout"] = - &::cli::thunk< options, &options::stdout__ >; - _cli_options_map_["--suppress-undocumented"] = - &::cli::thunk< options, &options::suppress_undocumented_ >; - _cli_options_map_["--suppress-usage"] = - &::cli::thunk< options, &options::suppress_usage_ >; - _cli_options_map_["--long-usage"] = - &::cli::thunk< options, &options::long_usage_ >; - _cli_options_map_["--short-usage"] = - &::cli::thunk< options, &options::short_usage_ >; - _cli_options_map_["--page-usage"] = - &::cli::thunk< options, std::string, &options::page_usage_, - &options::page_usage_specified_ >; - _cli_options_map_["--option-length"] = - &::cli::thunk< options, std::size_t, &options::option_length_, - &options::option_length_specified_ >; - _cli_options_map_["--ascii-tree"] = - &::cli::thunk< options, &options::ascii_tree_ >; - _cli_options_map_["--ansi-color"] = - &::cli::thunk< options, &options::ansi_color_ >; - _cli_options_map_["--exclude-base"] = - &::cli::thunk< options, &options::exclude_base_ >; - _cli_options_map_["--include-base-last"] = - &::cli::thunk< options, &options::include_base_last_ >; - _cli_options_map_["--class-doc"] = - &::cli::thunk< options, std::map, &options::class_doc_, - &options::class_doc_specified_ >; - _cli_options_map_["--class"] = - &::cli::thunk< options, std::vector, &options::class__, - &options::class__specified_ >; - _cli_options_map_["--docvar"] = - &::cli::thunk< options, std::map, &options::docvar_, - &options::docvar_specified_ >; - _cli_options_map_["-v"] = - &::cli::thunk< options, std::map, &options::docvar_, - &options::docvar_specified_ >; - _cli_options_map_["--link-regex"] = - &::cli::thunk< options, std::vector, &options::link_regex_, - &options::link_regex_specified_ >; - _cli_options_map_["--link-regex-trace"] = - &::cli::thunk< options, &options::link_regex_trace_ >; - _cli_options_map_["--html-heading-map"] = - &::cli::thunk< options, std::map, &options::html_heading_map_, - &options::html_heading_map_specified_ >; - _cli_options_map_["--omit-link-check"] = - &::cli::thunk< options, &options::omit_link_check_ >; - _cli_options_map_["--hxx-prologue"] = - &::cli::thunk< options, std::vector, &options::hxx_prologue_, - &options::hxx_prologue_specified_ >; - _cli_options_map_["--ixx-prologue"] = - &::cli::thunk< options, std::vector, &options::ixx_prologue_, - &options::ixx_prologue_specified_ >; - _cli_options_map_["--cxx-prologue"] = - &::cli::thunk< options, std::vector, &options::cxx_prologue_, - &options::cxx_prologue_specified_ >; - _cli_options_map_["--man-prologue"] = - &::cli::thunk< options, std::vector, &options::man_prologue_, - &options::man_prologue_specified_ >; - _cli_options_map_["--html-prologue"] = - &::cli::thunk< options, std::vector, &options::html_prologue_, - &options::html_prologue_specified_ >; - _cli_options_map_["--txt-prologue"] = - &::cli::thunk< options, std::vector, &options::txt_prologue_, - &options::txt_prologue_specified_ >; - _cli_options_map_["--hxx-epilogue"] = - &::cli::thunk< options, std::vector, &options::hxx_epilogue_, - &options::hxx_epilogue_specified_ >; - _cli_options_map_["--ixx-epilogue"] = - &::cli::thunk< options, std::vector, &options::ixx_epilogue_, - &options::ixx_epilogue_specified_ >; - _cli_options_map_["--cxx-epilogue"] = - &::cli::thunk< options, std::vector, &options::cxx_epilogue_, - &options::cxx_epilogue_specified_ >; - _cli_options_map_["--man-epilogue"] = - &::cli::thunk< options, std::vector, &options::man_epilogue_, - &options::man_epilogue_specified_ >; - _cli_options_map_["--html-epilogue"] = - &::cli::thunk< options, std::vector, &options::html_epilogue_, - &options::html_epilogue_specified_ >; - _cli_options_map_["--txt-epilogue"] = - &::cli::thunk< options, std::vector, &options::txt_epilogue_, - &options::txt_epilogue_specified_ >; - _cli_options_map_["--hxx-prologue-file"] = - &::cli::thunk< options, std::string, &options::hxx_prologue_file_, - &options::hxx_prologue_file_specified_ >; - _cli_options_map_["--ixx-prologue-file"] = - &::cli::thunk< options, std::string, &options::ixx_prologue_file_, - &options::ixx_prologue_file_specified_ >; - _cli_options_map_["--cxx-prologue-file"] = - &::cli::thunk< options, std::string, &options::cxx_prologue_file_, - &options::cxx_prologue_file_specified_ >; - _cli_options_map_["--man-prologue-file"] = - &::cli::thunk< options, std::string, &options::man_prologue_file_, - &options::man_prologue_file_specified_ >; - _cli_options_map_["--html-prologue-file"] = - &::cli::thunk< options, std::string, &options::html_prologue_file_, - &options::html_prologue_file_specified_ >; - _cli_options_map_["--txt-prologue-file"] = - &::cli::thunk< options, std::string, &options::txt_prologue_file_, - &options::txt_prologue_file_specified_ >; - _cli_options_map_["--hxx-epilogue-file"] = - &::cli::thunk< options, std::string, &options::hxx_epilogue_file_, - &options::hxx_epilogue_file_specified_ >; - _cli_options_map_["--ixx-epilogue-file"] = - &::cli::thunk< options, std::string, &options::ixx_epilogue_file_, - &options::ixx_epilogue_file_specified_ >; - _cli_options_map_["--cxx-epilogue-file"] = - &::cli::thunk< options, std::string, &options::cxx_epilogue_file_, - &options::cxx_epilogue_file_specified_ >; - _cli_options_map_["--man-epilogue-file"] = - &::cli::thunk< options, std::string, &options::man_epilogue_file_, - &options::man_epilogue_file_specified_ >; - _cli_options_map_["--html-epilogue-file"] = - &::cli::thunk< options, std::string, &options::html_epilogue_file_, - &options::html_epilogue_file_specified_ >; - _cli_options_map_["--txt-epilogue-file"] = - &::cli::thunk< options, std::string, &options::txt_epilogue_file_, - &options::txt_epilogue_file_specified_ >; - _cli_options_map_["--output-prefix"] = - &::cli::thunk< options, std::string, &options::output_prefix_, - &options::output_prefix_specified_ >; - _cli_options_map_["--output-suffix"] = - &::cli::thunk< options, std::string, &options::output_suffix_, - &options::output_suffix_specified_ >; - _cli_options_map_["--hxx-suffix"] = - &::cli::thunk< options, std::string, &options::hxx_suffix_, - &options::hxx_suffix_specified_ >; - _cli_options_map_["--ixx-suffix"] = - &::cli::thunk< options, std::string, &options::ixx_suffix_, - &options::ixx_suffix_specified_ >; - _cli_options_map_["--cxx-suffix"] = - &::cli::thunk< options, std::string, &options::cxx_suffix_, - &options::cxx_suffix_specified_ >; - _cli_options_map_["--man-suffix"] = - &::cli::thunk< options, std::string, &options::man_suffix_, - &options::man_suffix_specified_ >; - _cli_options_map_["--html-suffix"] = - &::cli::thunk< options, std::string, &options::html_suffix_, - &options::html_suffix_specified_ >; - _cli_options_map_["--txt-suffix"] = - &::cli::thunk< options, std::string, &options::txt_suffix_, - &options::txt_suffix_specified_ >; - _cli_options_map_["--option-prefix"] = - &::cli::thunk< options, std::string, &options::option_prefix_, - &options::option_prefix_specified_ >; - _cli_options_map_["--option-separator"] = - &::cli::thunk< options, std::string, &options::option_separator_, - &options::option_separator_specified_ >; - _cli_options_map_["--keep-separator"] = - &::cli::thunk< options, &options::keep_separator_ >; - _cli_options_map_["--no-combined-flags"] = - &::cli::thunk< options, &options::no_combined_flags_ >; - _cli_options_map_["--no-combined-values"] = - &::cli::thunk< options, &options::no_combined_values_ >; - _cli_options_map_["--include-with-brackets"] = - &::cli::thunk< options, &options::include_with_brackets_ >; - _cli_options_map_["--include-prefix"] = - &::cli::thunk< options, std::string, &options::include_prefix_, - &options::include_prefix_specified_ >; - _cli_options_map_["--guard-prefix"] = - &::cli::thunk< options, std::string, &options::guard_prefix_, - &options::guard_prefix_specified_ >; - _cli_options_map_["--reserved-name"] = - &::cli::thunk< options, std::map, &options::reserved_name_, - &options::reserved_name_specified_ >; - _cli_options_map_["--options-file"] = - &::cli::thunk< options, std::string, &options::options_file_, - &options::options_file_specified_ >; - } -}; - -static _cli_options_map_init _cli_options_map_init_; - -bool options:: -_parse (const char* o, ::cli::scanner& s) -{ - _cli_options_map::const_iterator i (_cli_options_map_.find (o)); - - if (i != _cli_options_map_.end ()) - { - (*(i->second)) (*this, s); - return true; - } - - return false; -} - -bool options:: -_parse (::cli::scanner& s, - ::cli::unknown_mode opt_mode, - ::cli::unknown_mode arg_mode) -{ - // Can't skip combined flags (--no-combined-flags). - // - assert (opt_mode != ::cli::unknown_mode::skip); - - bool r = false; - bool opt = true; - - while (s.more ()) - { - const char* o = s.peek (); - - if (std::strcmp (o, "--") == 0) - { - opt = false; - s.skip (); - r = true; - continue; - } - - if (opt) - { - if (_parse (o, s)) - { - r = true; - continue; - } - - if (std::strncmp (o, "-", 1) == 0 && o[1] != '\0') - { - // Handle combined option values. - // - std::string co; - if (const char* v = std::strchr (o, '=')) - { - co.assign (o, 0, v - o); - ++v; - - int ac (2); - char* av[] = - { - const_cast (co.c_str ()), - const_cast (v) - }; - - ::cli::argv_scanner ns (0, ac, av); - - if (_parse (co.c_str (), ns)) - { - // Parsed the option but not its value? - // - if (ns.end () != 2) - throw ::cli::invalid_value (co, v); - - s.next (); - r = true; - continue; - } - else - { - // Set the unknown option and fall through. - // - o = co.c_str (); - } - } - - // Handle combined flags. - // - char cf[3]; - { - const char* p = o + 1; - for (; *p != '\0'; ++p) - { - if (!((*p >= 'a' && *p <= 'z') || - (*p >= 'A' && *p <= 'Z') || - (*p >= '0' && *p <= '9'))) - break; - } - - if (*p == '\0') - { - for (p = o + 1; *p != '\0'; ++p) - { - std::strcpy (cf, "-"); - cf[1] = *p; - cf[2] = '\0'; - - int ac (1); - char* av[] = - { - cf - }; - - ::cli::argv_scanner ns (0, ac, av); - - if (!_parse (cf, ns)) - break; - } - - if (*p == '\0') - { - // All handled. - // - s.next (); - r = true; - continue; - } - else - { - // Set the unknown option and fall through. - // - o = cf; - } - } - } - - switch (opt_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - r = true; - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_option (o); - } - } - - break; - } - } - - switch (arg_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - r = true; - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_argument (o); - } - } - - break; - } - - return r; -} - -// Begin epilogue. -// -// -// End epilogue. - diff --git a/cli/cli/bootstrap/cli/options.hxx b/cli/cli/bootstrap/cli/options.hxx deleted file mode 100644 index 08180f3..0000000 --- a/cli/cli/bootstrap/cli/options.hxx +++ /dev/null @@ -1,1700 +0,0 @@ -// -*- C++ -*- -// -// This file was generated by CLI, a command line interface -// compiler for C++. -// - -#ifndef CLI_OPTIONS_HXX -#define CLI_OPTIONS_HXX - -// Begin prologue. -// -// -// End prologue. - -#include -#include -#include -#include -#include -#include - -#ifndef CLI_POTENTIALLY_UNUSED -# if defined(_MSC_VER) || defined(__xlC__) -# define CLI_POTENTIALLY_UNUSED(x) (void*)&x -# else -# define CLI_POTENTIALLY_UNUSED(x) (void)x -# endif -#endif - -namespace cli -{ - class usage_para - { - public: - enum value - { - none, - text, - option - }; - - usage_para (value); - - operator value () const - { - return v_; - } - - private: - value v_; - }; - - class unknown_mode - { - public: - enum value - { - skip, - stop, - fail - }; - - unknown_mode (value); - - operator value () const - { - return v_; - } - - private: - value v_; - }; - - // Exceptions. - // - - class exception: public std::exception - { - public: - virtual void - print (::std::ostream&) const = 0; - }; - - ::std::ostream& - operator<< (::std::ostream&, const exception&); - - class unknown_option: public exception - { - public: - virtual - ~unknown_option () throw (); - - unknown_option (const std::string& option); - - const std::string& - option () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class unknown_argument: public exception - { - public: - virtual - ~unknown_argument () throw (); - - unknown_argument (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - class missing_value: public exception - { - public: - virtual - ~missing_value () throw (); - - missing_value (const std::string& option); - - const std::string& - option () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class invalid_value: public exception - { - public: - virtual - ~invalid_value () throw (); - - invalid_value (const std::string& option, - const std::string& value, - const std::string& message = std::string ()); - - const std::string& - option () const; - - const std::string& - value () const; - - const std::string& - message () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - std::string value_; - std::string message_; - }; - - class eos_reached: public exception - { - public: - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - }; - - class file_io_failure: public exception - { - public: - virtual - ~file_io_failure () throw (); - - file_io_failure (const std::string& file); - - const std::string& - file () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string file_; - }; - - class unmatched_quote: public exception - { - public: - virtual - ~unmatched_quote () throw (); - - unmatched_quote (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (::std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - // Command line argument scanner interface. - // - // The values returned by next() are guaranteed to be valid - // for the two previous arguments up until a call to a third - // peek() or next(). - // - // The position() function returns a monotonically-increasing - // number which, if stored, can later be used to determine the - // relative position of the argument returned by the following - // call to next(). Note that if multiple scanners are used to - // extract arguments from multiple sources, then the end - // position of the previous scanner should be used as the - // start position of the next. - // - class scanner - { - public: - virtual - ~scanner (); - - virtual bool - more () = 0; - - virtual const char* - peek () = 0; - - virtual const char* - next () = 0; - - virtual void - skip () = 0; - - virtual std::size_t - position () = 0; - }; - - class argv_scanner: public scanner - { - public: - argv_scanner (int& argc, - char** argv, - bool erase = false, - std::size_t start_position = 0); - - argv_scanner (int start, - int& argc, - char** argv, - bool erase = false, - std::size_t start_position = 0); - - int - end () const; - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - virtual std::size_t - position (); - - protected: - std::size_t start_position_; - int i_; - int& argc_; - char** argv_; - bool erase_; - }; - - class argv_file_scanner: public argv_scanner - { - public: - argv_file_scanner (int& argc, - char** argv, - const std::string& option, - bool erase = false, - std::size_t start_position = 0); - - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& option, - bool erase = false, - std::size_t start_position = 0); - - argv_file_scanner (const std::string& file, - const std::string& option, - std::size_t start_position = 0); - - struct option_info - { - // If search_func is not NULL, it is called, with the arg - // value as the second argument, to locate the options file. - // If it returns an empty string, then the file is ignored. - // - const char* option; - std::string (*search_func) (const char*, void* arg); - void* arg; - }; - - argv_file_scanner (int& argc, - char** argv, - const option_info* options, - std::size_t options_count, - bool erase = false, - std::size_t start_position = 0); - - argv_file_scanner (int start, - int& argc, - char** argv, - const option_info* options, - std::size_t options_count, - bool erase = false, - std::size_t start_position = 0); - - argv_file_scanner (const std::string& file, - const option_info* options = 0, - std::size_t options_count = 0, - std::size_t start_position = 0); - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - virtual std::size_t - position (); - - // Return the file path if the peeked at argument came from a file and - // the empty string otherwise. The reference is guaranteed to be valid - // till the end of the scanner lifetime. - // - const std::string& - peek_file (); - - // Return the 1-based line number if the peeked at argument came from - // a file and zero otherwise. - // - std::size_t - peek_line (); - - private: - const option_info* - find (const char*) const; - - void - load (const std::string& file); - - typedef argv_scanner base; - - const std::string option_; - option_info option_info_; - const option_info* options_; - std::size_t options_count_; - - struct arg - { - std::string value; - const std::string* file; - std::size_t line; - }; - - std::deque args_; - std::list files_; - - // Circular buffer of two arguments. - // - std::string hold_[2]; - std::size_t i_; - - bool skip_; - - static int zero_argc_; - static std::string empty_string_; - }; - - template - struct parser; -} - -#include - -#include - -#include - -#include - -#include - -#include - -class options -{ - public: - options (); - - options (int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - options (int start, - int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - options (int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - options (int start, - int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - options (::cli::scanner&, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - // Option accessors and modifiers. - // - const std::uint64_t& - build2_metadata () const; - - std::uint64_t& - build2_metadata (); - - void - build2_metadata (const std::uint64_t&); - - bool - build2_metadata_specified () const; - - void - build2_metadata_specified (bool); - - const bool& - help () const; - - bool& - help (); - - void - help (const bool&); - - const bool& - version () const; - - bool& - version (); - - void - version (const bool&); - - const std::vector& - include_path () const; - - std::vector& - include_path (); - - void - include_path (const std::vector&); - - bool - include_path_specified () const; - - void - include_path_specified (bool); - - const std::string& - output_dir () const; - - std::string& - output_dir (); - - void - output_dir (const std::string&); - - bool - output_dir_specified () const; - - void - output_dir_specified (bool); - - const cxx_version& - std () const; - - cxx_version& - std (); - - void - std (const cxx_version&); - - bool - std_specified () const; - - void - std_specified (bool); - - const bool& - generate_modifier () const; - - bool& - generate_modifier (); - - void - generate_modifier (const bool&); - - const bool& - generate_specifier () const; - - bool& - generate_specifier (); - - void - generate_specifier (const bool&); - - const bool& - generate_parse () const; - - bool& - generate_parse (); - - void - generate_parse (const bool&); - - const bool& - generate_merge () const; - - bool& - generate_merge (); - - void - generate_merge (const bool&); - - const bool& - generate_description () const; - - bool& - generate_description (); - - void - generate_description (const bool&); - - const bool& - generate_file_scanner () const; - - bool& - generate_file_scanner (); - - void - generate_file_scanner (const bool&); - - const bool& - generate_vector_scanner () const; - - bool& - generate_vector_scanner (); - - void - generate_vector_scanner (const bool&); - - const bool& - generate_group_scanner () const; - - bool& - generate_group_scanner (); - - void - generate_group_scanner (const bool&); - - const bool& - suppress_inline () const; - - bool& - suppress_inline (); - - void - suppress_inline (const bool&); - - const bool& - suppress_cli () const; - - bool& - suppress_cli (); - - void - suppress_cli (const bool&); - - const std::string& - cli_namespace () const; - - std::string& - cli_namespace (); - - void - cli_namespace (const std::string&); - - bool - cli_namespace_specified () const; - - void - cli_namespace_specified (bool); - - const std::string& - ostream_type () const; - - std::string& - ostream_type (); - - void - ostream_type (const std::string&); - - bool - ostream_type_specified () const; - - void - ostream_type_specified (bool); - - const std::string& - export_symbol () const; - - std::string& - export_symbol (); - - void - export_symbol (const std::string&); - - bool - export_symbol_specified () const; - - void - export_symbol_specified (bool); - - const bool& - generate_cxx () const; - - bool& - generate_cxx (); - - void - generate_cxx (const bool&); - - const bool& - generate_man () const; - - bool& - generate_man (); - - void - generate_man (const bool&); - - const bool& - generate_html () const; - - bool& - generate_html (); - - void - generate_html (const bool&); - - const bool& - generate_txt () const; - - bool& - generate_txt (); - - void - generate_txt (const bool&); - - const bool& - stdout_ () const; - - bool& - stdout_ (); - - void - stdout_ (const bool&); - - const bool& - suppress_undocumented () const; - - bool& - suppress_undocumented (); - - void - suppress_undocumented (const bool&); - - const bool& - suppress_usage () const; - - bool& - suppress_usage (); - - void - suppress_usage (const bool&); - - const bool& - long_usage () const; - - bool& - long_usage (); - - void - long_usage (const bool&); - - const bool& - short_usage () const; - - bool& - short_usage (); - - void - short_usage (const bool&); - - const std::string& - page_usage () const; - - std::string& - page_usage (); - - void - page_usage (const std::string&); - - bool - page_usage_specified () const; - - void - page_usage_specified (bool); - - const std::size_t& - option_length () const; - - std::size_t& - option_length (); - - void - option_length (const std::size_t&); - - bool - option_length_specified () const; - - void - option_length_specified (bool); - - const bool& - ascii_tree () const; - - bool& - ascii_tree (); - - void - ascii_tree (const bool&); - - const bool& - ansi_color () const; - - bool& - ansi_color (); - - void - ansi_color (const bool&); - - const bool& - exclude_base () const; - - bool& - exclude_base (); - - void - exclude_base (const bool&); - - const bool& - include_base_last () const; - - bool& - include_base_last (); - - void - include_base_last (const bool&); - - const std::map& - class_doc () const; - - std::map& - class_doc (); - - void - class_doc (const std::map&); - - bool - class_doc_specified () const; - - void - class_doc_specified (bool); - - const std::vector& - class_ () const; - - std::vector& - class_ (); - - void - class_ (const std::vector&); - - bool - class__specified () const; - - void - class__specified (bool); - - const std::map& - docvar () const; - - std::map& - docvar (); - - void - docvar (const std::map&); - - bool - docvar_specified () const; - - void - docvar_specified (bool); - - const std::vector& - link_regex () const; - - std::vector& - link_regex (); - - void - link_regex (const std::vector&); - - bool - link_regex_specified () const; - - void - link_regex_specified (bool); - - const bool& - link_regex_trace () const; - - bool& - link_regex_trace (); - - void - link_regex_trace (const bool&); - - const std::map& - html_heading_map () const; - - std::map& - html_heading_map (); - - void - html_heading_map (const std::map&); - - bool - html_heading_map_specified () const; - - void - html_heading_map_specified (bool); - - const bool& - omit_link_check () const; - - bool& - omit_link_check (); - - void - omit_link_check (const bool&); - - const std::vector& - hxx_prologue () const; - - std::vector& - hxx_prologue (); - - void - hxx_prologue (const std::vector&); - - bool - hxx_prologue_specified () const; - - void - hxx_prologue_specified (bool); - - const std::vector& - ixx_prologue () const; - - std::vector& - ixx_prologue (); - - void - ixx_prologue (const std::vector&); - - bool - ixx_prologue_specified () const; - - void - ixx_prologue_specified (bool); - - const std::vector& - cxx_prologue () const; - - std::vector& - cxx_prologue (); - - void - cxx_prologue (const std::vector&); - - bool - cxx_prologue_specified () const; - - void - cxx_prologue_specified (bool); - - const std::vector& - man_prologue () const; - - std::vector& - man_prologue (); - - void - man_prologue (const std::vector&); - - bool - man_prologue_specified () const; - - void - man_prologue_specified (bool); - - const std::vector& - html_prologue () const; - - std::vector& - html_prologue (); - - void - html_prologue (const std::vector&); - - bool - html_prologue_specified () const; - - void - html_prologue_specified (bool); - - const std::vector& - txt_prologue () const; - - std::vector& - txt_prologue (); - - void - txt_prologue (const std::vector&); - - bool - txt_prologue_specified () const; - - void - txt_prologue_specified (bool); - - const std::vector& - hxx_epilogue () const; - - std::vector& - hxx_epilogue (); - - void - hxx_epilogue (const std::vector&); - - bool - hxx_epilogue_specified () const; - - void - hxx_epilogue_specified (bool); - - const std::vector& - ixx_epilogue () const; - - std::vector& - ixx_epilogue (); - - void - ixx_epilogue (const std::vector&); - - bool - ixx_epilogue_specified () const; - - void - ixx_epilogue_specified (bool); - - const std::vector& - cxx_epilogue () const; - - std::vector& - cxx_epilogue (); - - void - cxx_epilogue (const std::vector&); - - bool - cxx_epilogue_specified () const; - - void - cxx_epilogue_specified (bool); - - const std::vector& - man_epilogue () const; - - std::vector& - man_epilogue (); - - void - man_epilogue (const std::vector&); - - bool - man_epilogue_specified () const; - - void - man_epilogue_specified (bool); - - const std::vector& - html_epilogue () const; - - std::vector& - html_epilogue (); - - void - html_epilogue (const std::vector&); - - bool - html_epilogue_specified () const; - - void - html_epilogue_specified (bool); - - const std::vector& - txt_epilogue () const; - - std::vector& - txt_epilogue (); - - void - txt_epilogue (const std::vector&); - - bool - txt_epilogue_specified () const; - - void - txt_epilogue_specified (bool); - - const std::string& - hxx_prologue_file () const; - - std::string& - hxx_prologue_file (); - - void - hxx_prologue_file (const std::string&); - - bool - hxx_prologue_file_specified () const; - - void - hxx_prologue_file_specified (bool); - - const std::string& - ixx_prologue_file () const; - - std::string& - ixx_prologue_file (); - - void - ixx_prologue_file (const std::string&); - - bool - ixx_prologue_file_specified () const; - - void - ixx_prologue_file_specified (bool); - - const std::string& - cxx_prologue_file () const; - - std::string& - cxx_prologue_file (); - - void - cxx_prologue_file (const std::string&); - - bool - cxx_prologue_file_specified () const; - - void - cxx_prologue_file_specified (bool); - - const std::string& - man_prologue_file () const; - - std::string& - man_prologue_file (); - - void - man_prologue_file (const std::string&); - - bool - man_prologue_file_specified () const; - - void - man_prologue_file_specified (bool); - - const std::string& - html_prologue_file () const; - - std::string& - html_prologue_file (); - - void - html_prologue_file (const std::string&); - - bool - html_prologue_file_specified () const; - - void - html_prologue_file_specified (bool); - - const std::string& - txt_prologue_file () const; - - std::string& - txt_prologue_file (); - - void - txt_prologue_file (const std::string&); - - bool - txt_prologue_file_specified () const; - - void - txt_prologue_file_specified (bool); - - const std::string& - hxx_epilogue_file () const; - - std::string& - hxx_epilogue_file (); - - void - hxx_epilogue_file (const std::string&); - - bool - hxx_epilogue_file_specified () const; - - void - hxx_epilogue_file_specified (bool); - - const std::string& - ixx_epilogue_file () const; - - std::string& - ixx_epilogue_file (); - - void - ixx_epilogue_file (const std::string&); - - bool - ixx_epilogue_file_specified () const; - - void - ixx_epilogue_file_specified (bool); - - const std::string& - cxx_epilogue_file () const; - - std::string& - cxx_epilogue_file (); - - void - cxx_epilogue_file (const std::string&); - - bool - cxx_epilogue_file_specified () const; - - void - cxx_epilogue_file_specified (bool); - - const std::string& - man_epilogue_file () const; - - std::string& - man_epilogue_file (); - - void - man_epilogue_file (const std::string&); - - bool - man_epilogue_file_specified () const; - - void - man_epilogue_file_specified (bool); - - const std::string& - html_epilogue_file () const; - - std::string& - html_epilogue_file (); - - void - html_epilogue_file (const std::string&); - - bool - html_epilogue_file_specified () const; - - void - html_epilogue_file_specified (bool); - - const std::string& - txt_epilogue_file () const; - - std::string& - txt_epilogue_file (); - - void - txt_epilogue_file (const std::string&); - - bool - txt_epilogue_file_specified () const; - - void - txt_epilogue_file_specified (bool); - - const std::string& - output_prefix () const; - - std::string& - output_prefix (); - - void - output_prefix (const std::string&); - - bool - output_prefix_specified () const; - - void - output_prefix_specified (bool); - - const std::string& - output_suffix () const; - - std::string& - output_suffix (); - - void - output_suffix (const std::string&); - - bool - output_suffix_specified () const; - - void - output_suffix_specified (bool); - - const std::string& - hxx_suffix () const; - - std::string& - hxx_suffix (); - - void - hxx_suffix (const std::string&); - - bool - hxx_suffix_specified () const; - - void - hxx_suffix_specified (bool); - - const std::string& - ixx_suffix () const; - - std::string& - ixx_suffix (); - - void - ixx_suffix (const std::string&); - - bool - ixx_suffix_specified () const; - - void - ixx_suffix_specified (bool); - - const std::string& - cxx_suffix () const; - - std::string& - cxx_suffix (); - - void - cxx_suffix (const std::string&); - - bool - cxx_suffix_specified () const; - - void - cxx_suffix_specified (bool); - - const std::string& - man_suffix () const; - - std::string& - man_suffix (); - - void - man_suffix (const std::string&); - - bool - man_suffix_specified () const; - - void - man_suffix_specified (bool); - - const std::string& - html_suffix () const; - - std::string& - html_suffix (); - - void - html_suffix (const std::string&); - - bool - html_suffix_specified () const; - - void - html_suffix_specified (bool); - - const std::string& - txt_suffix () const; - - std::string& - txt_suffix (); - - void - txt_suffix (const std::string&); - - bool - txt_suffix_specified () const; - - void - txt_suffix_specified (bool); - - const std::string& - option_prefix () const; - - std::string& - option_prefix (); - - void - option_prefix (const std::string&); - - bool - option_prefix_specified () const; - - void - option_prefix_specified (bool); - - const std::string& - option_separator () const; - - std::string& - option_separator (); - - void - option_separator (const std::string&); - - bool - option_separator_specified () const; - - void - option_separator_specified (bool); - - const bool& - keep_separator () const; - - bool& - keep_separator (); - - void - keep_separator (const bool&); - - const bool& - no_combined_flags () const; - - bool& - no_combined_flags (); - - void - no_combined_flags (const bool&); - - const bool& - no_combined_values () const; - - bool& - no_combined_values (); - - void - no_combined_values (const bool&); - - const bool& - include_with_brackets () const; - - bool& - include_with_brackets (); - - void - include_with_brackets (const bool&); - - const std::string& - include_prefix () const; - - std::string& - include_prefix (); - - void - include_prefix (const std::string&); - - bool - include_prefix_specified () const; - - void - include_prefix_specified (bool); - - const std::string& - guard_prefix () const; - - std::string& - guard_prefix (); - - void - guard_prefix (const std::string&); - - bool - guard_prefix_specified () const; - - void - guard_prefix_specified (bool); - - const std::map& - reserved_name () const; - - std::map& - reserved_name (); - - void - reserved_name (const std::map&); - - bool - reserved_name_specified () const; - - void - reserved_name_specified (bool); - - const std::string& - options_file () const; - - std::string& - options_file (); - - void - options_file (const std::string&); - - bool - options_file_specified () const; - - void - options_file_specified (bool); - - // Print usage information. - // - static ::cli::usage_para - print_usage (::std::ostream&, - ::cli::usage_para = ::cli::usage_para::none); - - // Implementation details. - // - protected: - bool - _parse (const char*, ::cli::scanner&); - - private: - bool - _parse (::cli::scanner&, - ::cli::unknown_mode option, - ::cli::unknown_mode argument); - - public: - std::uint64_t build2_metadata_; - bool build2_metadata_specified_; - bool help_; - bool version_; - std::vector include_path_; - bool include_path_specified_; - std::string output_dir_; - bool output_dir_specified_; - cxx_version std_; - bool std_specified_; - bool generate_modifier_; - bool generate_specifier_; - bool generate_parse_; - bool generate_merge_; - bool generate_description_; - bool generate_file_scanner_; - bool generate_vector_scanner_; - bool generate_group_scanner_; - bool suppress_inline_; - bool suppress_cli_; - std::string cli_namespace_; - bool cli_namespace_specified_; - std::string ostream_type_; - bool ostream_type_specified_; - std::string export_symbol_; - bool export_symbol_specified_; - bool generate_cxx_; - bool generate_man_; - bool generate_html_; - bool generate_txt_; - bool stdout__; - bool suppress_undocumented_; - bool suppress_usage_; - bool long_usage_; - bool short_usage_; - std::string page_usage_; - bool page_usage_specified_; - std::size_t option_length_; - bool option_length_specified_; - bool ascii_tree_; - bool ansi_color_; - bool exclude_base_; - bool include_base_last_; - std::map class_doc_; - bool class_doc_specified_; - std::vector class__; - bool class__specified_; - std::map docvar_; - bool docvar_specified_; - std::vector link_regex_; - bool link_regex_specified_; - bool link_regex_trace_; - std::map html_heading_map_; - bool html_heading_map_specified_; - bool omit_link_check_; - std::vector hxx_prologue_; - bool hxx_prologue_specified_; - std::vector ixx_prologue_; - bool ixx_prologue_specified_; - std::vector cxx_prologue_; - bool cxx_prologue_specified_; - std::vector man_prologue_; - bool man_prologue_specified_; - std::vector html_prologue_; - bool html_prologue_specified_; - std::vector txt_prologue_; - bool txt_prologue_specified_; - std::vector hxx_epilogue_; - bool hxx_epilogue_specified_; - std::vector ixx_epilogue_; - bool ixx_epilogue_specified_; - std::vector cxx_epilogue_; - bool cxx_epilogue_specified_; - std::vector man_epilogue_; - bool man_epilogue_specified_; - std::vector html_epilogue_; - bool html_epilogue_specified_; - std::vector txt_epilogue_; - bool txt_epilogue_specified_; - std::string hxx_prologue_file_; - bool hxx_prologue_file_specified_; - std::string ixx_prologue_file_; - bool ixx_prologue_file_specified_; - std::string cxx_prologue_file_; - bool cxx_prologue_file_specified_; - std::string man_prologue_file_; - bool man_prologue_file_specified_; - std::string html_prologue_file_; - bool html_prologue_file_specified_; - std::string txt_prologue_file_; - bool txt_prologue_file_specified_; - std::string hxx_epilogue_file_; - bool hxx_epilogue_file_specified_; - std::string ixx_epilogue_file_; - bool ixx_epilogue_file_specified_; - std::string cxx_epilogue_file_; - bool cxx_epilogue_file_specified_; - std::string man_epilogue_file_; - bool man_epilogue_file_specified_; - std::string html_epilogue_file_; - bool html_epilogue_file_specified_; - std::string txt_epilogue_file_; - bool txt_epilogue_file_specified_; - std::string output_prefix_; - bool output_prefix_specified_; - std::string output_suffix_; - bool output_suffix_specified_; - std::string hxx_suffix_; - bool hxx_suffix_specified_; - std::string ixx_suffix_; - bool ixx_suffix_specified_; - std::string cxx_suffix_; - bool cxx_suffix_specified_; - std::string man_suffix_; - bool man_suffix_specified_; - std::string html_suffix_; - bool html_suffix_specified_; - std::string txt_suffix_; - bool txt_suffix_specified_; - std::string option_prefix_; - bool option_prefix_specified_; - std::string option_separator_; - bool option_separator_specified_; - bool keep_separator_; - bool no_combined_flags_; - bool no_combined_values_; - bool include_with_brackets_; - std::string include_prefix_; - bool include_prefix_specified_; - std::string guard_prefix_; - bool guard_prefix_specified_; - std::map reserved_name_; - bool reserved_name_specified_; - std::string options_file_; - bool options_file_specified_; -}; - -#include - -// Begin epilogue. -// -// -// End epilogue. - -#endif // CLI_OPTIONS_HXX diff --git a/cli/cli/bootstrap/cli/options.ixx b/cli/cli/bootstrap/cli/options.ixx deleted file mode 100644 index e3fd397..0000000 --- a/cli/cli/bootstrap/cli/options.ixx +++ /dev/null @@ -1,2400 +0,0 @@ -// -*- C++ -*- -// -// This file was generated by CLI, a command line interface -// compiler for C++. -// - -// Begin prologue. -// -// -// End prologue. - -#include - -namespace cli -{ - // usage_para - // - inline usage_para:: - usage_para (value v) - : v_ (v) - { - } - - // unknown_mode - // - inline unknown_mode:: - unknown_mode (value v) - : v_ (v) - { - } - - // exception - // - inline ::std::ostream& - operator<< (::std::ostream& os, const exception& e) - { - e.print (os); - return os; - } - - // unknown_option - // - inline unknown_option:: - unknown_option (const std::string& option) - : option_ (option) - { - } - - inline const std::string& unknown_option:: - option () const - { - return option_; - } - - // unknown_argument - // - inline unknown_argument:: - unknown_argument (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unknown_argument:: - argument () const - { - return argument_; - } - - // missing_value - // - inline missing_value:: - missing_value (const std::string& option) - : option_ (option) - { - } - - inline const std::string& missing_value:: - option () const - { - return option_; - } - - // invalid_value - // - inline invalid_value:: - invalid_value (const std::string& option, - const std::string& value, - const std::string& message) - : option_ (option), - value_ (value), - message_ (message) - { - } - - inline const std::string& invalid_value:: - option () const - { - return option_; - } - - inline const std::string& invalid_value:: - value () const - { - return value_; - } - - inline const std::string& invalid_value:: - message () const - { - return message_; - } - - // file_io_failure - // - inline file_io_failure:: - file_io_failure (const std::string& file) - : file_ (file) - { - } - - inline const std::string& file_io_failure:: - file () const - { - return file_; - } - - // unmatched_quote - // - inline unmatched_quote:: - unmatched_quote (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unmatched_quote:: - argument () const - { - return argument_; - } - - // argv_scanner - // - inline argv_scanner:: - argv_scanner (int& argc, - char** argv, - bool erase, - std::size_t sp) - : start_position_ (sp + 1), - i_ (1), - argc_ (argc), - argv_ (argv), - erase_ (erase) - { - } - - inline argv_scanner:: - argv_scanner (int start, - int& argc, - char** argv, - bool erase, - std::size_t sp) - : start_position_ (sp + static_cast (start)), - i_ (start), - argc_ (argc), - argv_ (argv), - erase_ (erase) - { - } - - inline int argv_scanner:: - end () const - { - return i_; - } - - // argv_file_scanner - // - inline argv_file_scanner:: - argv_file_scanner (int& argc, - char** argv, - const std::string& option, - bool erase, - std::size_t sp) - : argv_scanner (argc, argv, erase, sp), - option_ (option), - options_ (&option_info_), - options_count_ (1), - i_ (1), - skip_ (false) - { - option_info_.option = option_.c_str (); - option_info_.search_func = 0; - } - - inline argv_file_scanner:: - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& option, - bool erase, - std::size_t sp) - : argv_scanner (start, argc, argv, erase, sp), - option_ (option), - options_ (&option_info_), - options_count_ (1), - i_ (1), - skip_ (false) - { - option_info_.option = option_.c_str (); - option_info_.search_func = 0; - } - - inline argv_file_scanner:: - argv_file_scanner (const std::string& file, - const std::string& option, - std::size_t sp) - : argv_scanner (0, zero_argc_, 0, sp), - option_ (option), - options_ (&option_info_), - options_count_ (1), - i_ (1), - skip_ (false) - { - option_info_.option = option_.c_str (); - option_info_.search_func = 0; - - load (file); - } - - inline argv_file_scanner:: - argv_file_scanner (int& argc, - char** argv, - const option_info* options, - std::size_t options_count, - bool erase, - std::size_t sp) - : argv_scanner (argc, argv, erase, sp), - options_ (options), - options_count_ (options_count), - i_ (1), - skip_ (false) - { - } - - inline argv_file_scanner:: - argv_file_scanner (int start, - int& argc, - char** argv, - const option_info* options, - std::size_t options_count, - bool erase, - std::size_t sp) - : argv_scanner (start, argc, argv, erase, sp), - options_ (options), - options_count_ (options_count), - i_ (1), - skip_ (false) - { - } - - inline argv_file_scanner:: - argv_file_scanner (const std::string& file, - const option_info* options, - std::size_t options_count, - std::size_t sp) - : argv_scanner (0, zero_argc_, 0, sp), - options_ (options), - options_count_ (options_count), - i_ (1), - skip_ (false) - { - load (file); - } -} - -// options -// - -inline const std::uint64_t& options:: -build2_metadata () const -{ - return this->build2_metadata_; -} - -inline std::uint64_t& options:: -build2_metadata () -{ - return this->build2_metadata_; -} - -inline void options:: -build2_metadata (const std::uint64_t& x) -{ - this->build2_metadata_ = x; -} - -inline bool options:: -build2_metadata_specified () const -{ - return this->build2_metadata_specified_; -} - -inline void options:: -build2_metadata_specified (bool x) -{ - this->build2_metadata_specified_ = x; -} - -inline const bool& options:: -help () const -{ - return this->help_; -} - -inline bool& options:: -help () -{ - return this->help_; -} - -inline void options:: -help (const bool& x) -{ - this->help_ = x; -} - -inline const bool& options:: -version () const -{ - return this->version_; -} - -inline bool& options:: -version () -{ - return this->version_; -} - -inline void options:: -version (const bool& x) -{ - this->version_ = x; -} - -inline const std::vector& options:: -include_path () const -{ - return this->include_path_; -} - -inline std::vector& options:: -include_path () -{ - return this->include_path_; -} - -inline void options:: -include_path (const std::vector& x) -{ - this->include_path_ = x; -} - -inline bool options:: -include_path_specified () const -{ - return this->include_path_specified_; -} - -inline void options:: -include_path_specified (bool x) -{ - this->include_path_specified_ = x; -} - -inline const std::string& options:: -output_dir () const -{ - return this->output_dir_; -} - -inline std::string& options:: -output_dir () -{ - return this->output_dir_; -} - -inline void options:: -output_dir (const std::string& x) -{ - this->output_dir_ = x; -} - -inline bool options:: -output_dir_specified () const -{ - return this->output_dir_specified_; -} - -inline void options:: -output_dir_specified (bool x) -{ - this->output_dir_specified_ = x; -} - -inline const cxx_version& options:: -std () const -{ - return this->std_; -} - -inline cxx_version& options:: -std () -{ - return this->std_; -} - -inline void options:: -std (const cxx_version& x) -{ - this->std_ = x; -} - -inline bool options:: -std_specified () const -{ - return this->std_specified_; -} - -inline void options:: -std_specified (bool x) -{ - this->std_specified_ = x; -} - -inline const bool& options:: -generate_modifier () const -{ - return this->generate_modifier_; -} - -inline bool& options:: -generate_modifier () -{ - return this->generate_modifier_; -} - -inline void options:: -generate_modifier (const bool& x) -{ - this->generate_modifier_ = x; -} - -inline const bool& options:: -generate_specifier () const -{ - return this->generate_specifier_; -} - -inline bool& options:: -generate_specifier () -{ - return this->generate_specifier_; -} - -inline void options:: -generate_specifier (const bool& x) -{ - this->generate_specifier_ = x; -} - -inline const bool& options:: -generate_parse () const -{ - return this->generate_parse_; -} - -inline bool& options:: -generate_parse () -{ - return this->generate_parse_; -} - -inline void options:: -generate_parse (const bool& x) -{ - this->generate_parse_ = x; -} - -inline const bool& options:: -generate_merge () const -{ - return this->generate_merge_; -} - -inline bool& options:: -generate_merge () -{ - return this->generate_merge_; -} - -inline void options:: -generate_merge (const bool& x) -{ - this->generate_merge_ = x; -} - -inline const bool& options:: -generate_description () const -{ - return this->generate_description_; -} - -inline bool& options:: -generate_description () -{ - return this->generate_description_; -} - -inline void options:: -generate_description (const bool& x) -{ - this->generate_description_ = x; -} - -inline const bool& options:: -generate_file_scanner () const -{ - return this->generate_file_scanner_; -} - -inline bool& options:: -generate_file_scanner () -{ - return this->generate_file_scanner_; -} - -inline void options:: -generate_file_scanner (const bool& x) -{ - this->generate_file_scanner_ = x; -} - -inline const bool& options:: -generate_vector_scanner () const -{ - return this->generate_vector_scanner_; -} - -inline bool& options:: -generate_vector_scanner () -{ - return this->generate_vector_scanner_; -} - -inline void options:: -generate_vector_scanner (const bool& x) -{ - this->generate_vector_scanner_ = x; -} - -inline const bool& options:: -generate_group_scanner () const -{ - return this->generate_group_scanner_; -} - -inline bool& options:: -generate_group_scanner () -{ - return this->generate_group_scanner_; -} - -inline void options:: -generate_group_scanner (const bool& x) -{ - this->generate_group_scanner_ = x; -} - -inline const bool& options:: -suppress_inline () const -{ - return this->suppress_inline_; -} - -inline bool& options:: -suppress_inline () -{ - return this->suppress_inline_; -} - -inline void options:: -suppress_inline (const bool& x) -{ - this->suppress_inline_ = x; -} - -inline const bool& options:: -suppress_cli () const -{ - return this->suppress_cli_; -} - -inline bool& options:: -suppress_cli () -{ - return this->suppress_cli_; -} - -inline void options:: -suppress_cli (const bool& x) -{ - this->suppress_cli_ = x; -} - -inline const std::string& options:: -cli_namespace () const -{ - return this->cli_namespace_; -} - -inline std::string& options:: -cli_namespace () -{ - return this->cli_namespace_; -} - -inline void options:: -cli_namespace (const std::string& x) -{ - this->cli_namespace_ = x; -} - -inline bool options:: -cli_namespace_specified () const -{ - return this->cli_namespace_specified_; -} - -inline void options:: -cli_namespace_specified (bool x) -{ - this->cli_namespace_specified_ = x; -} - -inline const std::string& options:: -ostream_type () const -{ - return this->ostream_type_; -} - -inline std::string& options:: -ostream_type () -{ - return this->ostream_type_; -} - -inline void options:: -ostream_type (const std::string& x) -{ - this->ostream_type_ = x; -} - -inline bool options:: -ostream_type_specified () const -{ - return this->ostream_type_specified_; -} - -inline void options:: -ostream_type_specified (bool x) -{ - this->ostream_type_specified_ = x; -} - -inline const std::string& options:: -export_symbol () const -{ - return this->export_symbol_; -} - -inline std::string& options:: -export_symbol () -{ - return this->export_symbol_; -} - -inline void options:: -export_symbol (const std::string& x) -{ - this->export_symbol_ = x; -} - -inline bool options:: -export_symbol_specified () const -{ - return this->export_symbol_specified_; -} - -inline void options:: -export_symbol_specified (bool x) -{ - this->export_symbol_specified_ = x; -} - -inline const bool& options:: -generate_cxx () const -{ - return this->generate_cxx_; -} - -inline bool& options:: -generate_cxx () -{ - return this->generate_cxx_; -} - -inline void options:: -generate_cxx (const bool& x) -{ - this->generate_cxx_ = x; -} - -inline const bool& options:: -generate_man () const -{ - return this->generate_man_; -} - -inline bool& options:: -generate_man () -{ - return this->generate_man_; -} - -inline void options:: -generate_man (const bool& x) -{ - this->generate_man_ = x; -} - -inline const bool& options:: -generate_html () const -{ - return this->generate_html_; -} - -inline bool& options:: -generate_html () -{ - return this->generate_html_; -} - -inline void options:: -generate_html (const bool& x) -{ - this->generate_html_ = x; -} - -inline const bool& options:: -generate_txt () const -{ - return this->generate_txt_; -} - -inline bool& options:: -generate_txt () -{ - return this->generate_txt_; -} - -inline void options:: -generate_txt (const bool& x) -{ - this->generate_txt_ = x; -} - -inline const bool& options:: -stdout_ () const -{ - return this->stdout__; -} - -inline bool& options:: -stdout_ () -{ - return this->stdout__; -} - -inline void options:: -stdout_ (const bool& x) -{ - this->stdout__ = x; -} - -inline const bool& options:: -suppress_undocumented () const -{ - return this->suppress_undocumented_; -} - -inline bool& options:: -suppress_undocumented () -{ - return this->suppress_undocumented_; -} - -inline void options:: -suppress_undocumented (const bool& x) -{ - this->suppress_undocumented_ = x; -} - -inline const bool& options:: -suppress_usage () const -{ - return this->suppress_usage_; -} - -inline bool& options:: -suppress_usage () -{ - return this->suppress_usage_; -} - -inline void options:: -suppress_usage (const bool& x) -{ - this->suppress_usage_ = x; -} - -inline const bool& options:: -long_usage () const -{ - return this->long_usage_; -} - -inline bool& options:: -long_usage () -{ - return this->long_usage_; -} - -inline void options:: -long_usage (const bool& x) -{ - this->long_usage_ = x; -} - -inline const bool& options:: -short_usage () const -{ - return this->short_usage_; -} - -inline bool& options:: -short_usage () -{ - return this->short_usage_; -} - -inline void options:: -short_usage (const bool& x) -{ - this->short_usage_ = x; -} - -inline const std::string& options:: -page_usage () const -{ - return this->page_usage_; -} - -inline std::string& options:: -page_usage () -{ - return this->page_usage_; -} - -inline void options:: -page_usage (const std::string& x) -{ - this->page_usage_ = x; -} - -inline bool options:: -page_usage_specified () const -{ - return this->page_usage_specified_; -} - -inline void options:: -page_usage_specified (bool x) -{ - this->page_usage_specified_ = x; -} - -inline const std::size_t& options:: -option_length () const -{ - return this->option_length_; -} - -inline std::size_t& options:: -option_length () -{ - return this->option_length_; -} - -inline void options:: -option_length (const std::size_t& x) -{ - this->option_length_ = x; -} - -inline bool options:: -option_length_specified () const -{ - return this->option_length_specified_; -} - -inline void options:: -option_length_specified (bool x) -{ - this->option_length_specified_ = x; -} - -inline const bool& options:: -ascii_tree () const -{ - return this->ascii_tree_; -} - -inline bool& options:: -ascii_tree () -{ - return this->ascii_tree_; -} - -inline void options:: -ascii_tree (const bool& x) -{ - this->ascii_tree_ = x; -} - -inline const bool& options:: -ansi_color () const -{ - return this->ansi_color_; -} - -inline bool& options:: -ansi_color () -{ - return this->ansi_color_; -} - -inline void options:: -ansi_color (const bool& x) -{ - this->ansi_color_ = x; -} - -inline const bool& options:: -exclude_base () const -{ - return this->exclude_base_; -} - -inline bool& options:: -exclude_base () -{ - return this->exclude_base_; -} - -inline void options:: -exclude_base (const bool& x) -{ - this->exclude_base_ = x; -} - -inline const bool& options:: -include_base_last () const -{ - return this->include_base_last_; -} - -inline bool& options:: -include_base_last () -{ - return this->include_base_last_; -} - -inline void options:: -include_base_last (const bool& x) -{ - this->include_base_last_ = x; -} - -inline const std::map& options:: -class_doc () const -{ - return this->class_doc_; -} - -inline std::map& options:: -class_doc () -{ - return this->class_doc_; -} - -inline void options:: -class_doc (const std::map& x) -{ - this->class_doc_ = x; -} - -inline bool options:: -class_doc_specified () const -{ - return this->class_doc_specified_; -} - -inline void options:: -class_doc_specified (bool x) -{ - this->class_doc_specified_ = x; -} - -inline const std::vector& options:: -class_ () const -{ - return this->class__; -} - -inline std::vector& options:: -class_ () -{ - return this->class__; -} - -inline void options:: -class_ (const std::vector& x) -{ - this->class__ = x; -} - -inline bool options:: -class__specified () const -{ - return this->class__specified_; -} - -inline void options:: -class__specified (bool x) -{ - this->class__specified_ = x; -} - -inline const std::map& options:: -docvar () const -{ - return this->docvar_; -} - -inline std::map& options:: -docvar () -{ - return this->docvar_; -} - -inline void options:: -docvar (const std::map& x) -{ - this->docvar_ = x; -} - -inline bool options:: -docvar_specified () const -{ - return this->docvar_specified_; -} - -inline void options:: -docvar_specified (bool x) -{ - this->docvar_specified_ = x; -} - -inline const std::vector& options:: -link_regex () const -{ - return this->link_regex_; -} - -inline std::vector& options:: -link_regex () -{ - return this->link_regex_; -} - -inline void options:: -link_regex (const std::vector& x) -{ - this->link_regex_ = x; -} - -inline bool options:: -link_regex_specified () const -{ - return this->link_regex_specified_; -} - -inline void options:: -link_regex_specified (bool x) -{ - this->link_regex_specified_ = x; -} - -inline const bool& options:: -link_regex_trace () const -{ - return this->link_regex_trace_; -} - -inline bool& options:: -link_regex_trace () -{ - return this->link_regex_trace_; -} - -inline void options:: -link_regex_trace (const bool& x) -{ - this->link_regex_trace_ = x; -} - -inline const std::map& options:: -html_heading_map () const -{ - return this->html_heading_map_; -} - -inline std::map& options:: -html_heading_map () -{ - return this->html_heading_map_; -} - -inline void options:: -html_heading_map (const std::map& x) -{ - this->html_heading_map_ = x; -} - -inline bool options:: -html_heading_map_specified () const -{ - return this->html_heading_map_specified_; -} - -inline void options:: -html_heading_map_specified (bool x) -{ - this->html_heading_map_specified_ = x; -} - -inline const bool& options:: -omit_link_check () const -{ - return this->omit_link_check_; -} - -inline bool& options:: -omit_link_check () -{ - return this->omit_link_check_; -} - -inline void options:: -omit_link_check (const bool& x) -{ - this->omit_link_check_ = x; -} - -inline const std::vector& options:: -hxx_prologue () const -{ - return this->hxx_prologue_; -} - -inline std::vector& options:: -hxx_prologue () -{ - return this->hxx_prologue_; -} - -inline void options:: -hxx_prologue (const std::vector& x) -{ - this->hxx_prologue_ = x; -} - -inline bool options:: -hxx_prologue_specified () const -{ - return this->hxx_prologue_specified_; -} - -inline void options:: -hxx_prologue_specified (bool x) -{ - this->hxx_prologue_specified_ = x; -} - -inline const std::vector& options:: -ixx_prologue () const -{ - return this->ixx_prologue_; -} - -inline std::vector& options:: -ixx_prologue () -{ - return this->ixx_prologue_; -} - -inline void options:: -ixx_prologue (const std::vector& x) -{ - this->ixx_prologue_ = x; -} - -inline bool options:: -ixx_prologue_specified () const -{ - return this->ixx_prologue_specified_; -} - -inline void options:: -ixx_prologue_specified (bool x) -{ - this->ixx_prologue_specified_ = x; -} - -inline const std::vector& options:: -cxx_prologue () const -{ - return this->cxx_prologue_; -} - -inline std::vector& options:: -cxx_prologue () -{ - return this->cxx_prologue_; -} - -inline void options:: -cxx_prologue (const std::vector& x) -{ - this->cxx_prologue_ = x; -} - -inline bool options:: -cxx_prologue_specified () const -{ - return this->cxx_prologue_specified_; -} - -inline void options:: -cxx_prologue_specified (bool x) -{ - this->cxx_prologue_specified_ = x; -} - -inline const std::vector& options:: -man_prologue () const -{ - return this->man_prologue_; -} - -inline std::vector& options:: -man_prologue () -{ - return this->man_prologue_; -} - -inline void options:: -man_prologue (const std::vector& x) -{ - this->man_prologue_ = x; -} - -inline bool options:: -man_prologue_specified () const -{ - return this->man_prologue_specified_; -} - -inline void options:: -man_prologue_specified (bool x) -{ - this->man_prologue_specified_ = x; -} - -inline const std::vector& options:: -html_prologue () const -{ - return this->html_prologue_; -} - -inline std::vector& options:: -html_prologue () -{ - return this->html_prologue_; -} - -inline void options:: -html_prologue (const std::vector& x) -{ - this->html_prologue_ = x; -} - -inline bool options:: -html_prologue_specified () const -{ - return this->html_prologue_specified_; -} - -inline void options:: -html_prologue_specified (bool x) -{ - this->html_prologue_specified_ = x; -} - -inline const std::vector& options:: -txt_prologue () const -{ - return this->txt_prologue_; -} - -inline std::vector& options:: -txt_prologue () -{ - return this->txt_prologue_; -} - -inline void options:: -txt_prologue (const std::vector& x) -{ - this->txt_prologue_ = x; -} - -inline bool options:: -txt_prologue_specified () const -{ - return this->txt_prologue_specified_; -} - -inline void options:: -txt_prologue_specified (bool x) -{ - this->txt_prologue_specified_ = x; -} - -inline const std::vector& options:: -hxx_epilogue () const -{ - return this->hxx_epilogue_; -} - -inline std::vector& options:: -hxx_epilogue () -{ - return this->hxx_epilogue_; -} - -inline void options:: -hxx_epilogue (const std::vector& x) -{ - this->hxx_epilogue_ = x; -} - -inline bool options:: -hxx_epilogue_specified () const -{ - return this->hxx_epilogue_specified_; -} - -inline void options:: -hxx_epilogue_specified (bool x) -{ - this->hxx_epilogue_specified_ = x; -} - -inline const std::vector& options:: -ixx_epilogue () const -{ - return this->ixx_epilogue_; -} - -inline std::vector& options:: -ixx_epilogue () -{ - return this->ixx_epilogue_; -} - -inline void options:: -ixx_epilogue (const std::vector& x) -{ - this->ixx_epilogue_ = x; -} - -inline bool options:: -ixx_epilogue_specified () const -{ - return this->ixx_epilogue_specified_; -} - -inline void options:: -ixx_epilogue_specified (bool x) -{ - this->ixx_epilogue_specified_ = x; -} - -inline const std::vector& options:: -cxx_epilogue () const -{ - return this->cxx_epilogue_; -} - -inline std::vector& options:: -cxx_epilogue () -{ - return this->cxx_epilogue_; -} - -inline void options:: -cxx_epilogue (const std::vector& x) -{ - this->cxx_epilogue_ = x; -} - -inline bool options:: -cxx_epilogue_specified () const -{ - return this->cxx_epilogue_specified_; -} - -inline void options:: -cxx_epilogue_specified (bool x) -{ - this->cxx_epilogue_specified_ = x; -} - -inline const std::vector& options:: -man_epilogue () const -{ - return this->man_epilogue_; -} - -inline std::vector& options:: -man_epilogue () -{ - return this->man_epilogue_; -} - -inline void options:: -man_epilogue (const std::vector& x) -{ - this->man_epilogue_ = x; -} - -inline bool options:: -man_epilogue_specified () const -{ - return this->man_epilogue_specified_; -} - -inline void options:: -man_epilogue_specified (bool x) -{ - this->man_epilogue_specified_ = x; -} - -inline const std::vector& options:: -html_epilogue () const -{ - return this->html_epilogue_; -} - -inline std::vector& options:: -html_epilogue () -{ - return this->html_epilogue_; -} - -inline void options:: -html_epilogue (const std::vector& x) -{ - this->html_epilogue_ = x; -} - -inline bool options:: -html_epilogue_specified () const -{ - return this->html_epilogue_specified_; -} - -inline void options:: -html_epilogue_specified (bool x) -{ - this->html_epilogue_specified_ = x; -} - -inline const std::vector& options:: -txt_epilogue () const -{ - return this->txt_epilogue_; -} - -inline std::vector& options:: -txt_epilogue () -{ - return this->txt_epilogue_; -} - -inline void options:: -txt_epilogue (const std::vector& x) -{ - this->txt_epilogue_ = x; -} - -inline bool options:: -txt_epilogue_specified () const -{ - return this->txt_epilogue_specified_; -} - -inline void options:: -txt_epilogue_specified (bool x) -{ - this->txt_epilogue_specified_ = x; -} - -inline const std::string& options:: -hxx_prologue_file () const -{ - return this->hxx_prologue_file_; -} - -inline std::string& options:: -hxx_prologue_file () -{ - return this->hxx_prologue_file_; -} - -inline void options:: -hxx_prologue_file (const std::string& x) -{ - this->hxx_prologue_file_ = x; -} - -inline bool options:: -hxx_prologue_file_specified () const -{ - return this->hxx_prologue_file_specified_; -} - -inline void options:: -hxx_prologue_file_specified (bool x) -{ - this->hxx_prologue_file_specified_ = x; -} - -inline const std::string& options:: -ixx_prologue_file () const -{ - return this->ixx_prologue_file_; -} - -inline std::string& options:: -ixx_prologue_file () -{ - return this->ixx_prologue_file_; -} - -inline void options:: -ixx_prologue_file (const std::string& x) -{ - this->ixx_prologue_file_ = x; -} - -inline bool options:: -ixx_prologue_file_specified () const -{ - return this->ixx_prologue_file_specified_; -} - -inline void options:: -ixx_prologue_file_specified (bool x) -{ - this->ixx_prologue_file_specified_ = x; -} - -inline const std::string& options:: -cxx_prologue_file () const -{ - return this->cxx_prologue_file_; -} - -inline std::string& options:: -cxx_prologue_file () -{ - return this->cxx_prologue_file_; -} - -inline void options:: -cxx_prologue_file (const std::string& x) -{ - this->cxx_prologue_file_ = x; -} - -inline bool options:: -cxx_prologue_file_specified () const -{ - return this->cxx_prologue_file_specified_; -} - -inline void options:: -cxx_prologue_file_specified (bool x) -{ - this->cxx_prologue_file_specified_ = x; -} - -inline const std::string& options:: -man_prologue_file () const -{ - return this->man_prologue_file_; -} - -inline std::string& options:: -man_prologue_file () -{ - return this->man_prologue_file_; -} - -inline void options:: -man_prologue_file (const std::string& x) -{ - this->man_prologue_file_ = x; -} - -inline bool options:: -man_prologue_file_specified () const -{ - return this->man_prologue_file_specified_; -} - -inline void options:: -man_prologue_file_specified (bool x) -{ - this->man_prologue_file_specified_ = x; -} - -inline const std::string& options:: -html_prologue_file () const -{ - return this->html_prologue_file_; -} - -inline std::string& options:: -html_prologue_file () -{ - return this->html_prologue_file_; -} - -inline void options:: -html_prologue_file (const std::string& x) -{ - this->html_prologue_file_ = x; -} - -inline bool options:: -html_prologue_file_specified () const -{ - return this->html_prologue_file_specified_; -} - -inline void options:: -html_prologue_file_specified (bool x) -{ - this->html_prologue_file_specified_ = x; -} - -inline const std::string& options:: -txt_prologue_file () const -{ - return this->txt_prologue_file_; -} - -inline std::string& options:: -txt_prologue_file () -{ - return this->txt_prologue_file_; -} - -inline void options:: -txt_prologue_file (const std::string& x) -{ - this->txt_prologue_file_ = x; -} - -inline bool options:: -txt_prologue_file_specified () const -{ - return this->txt_prologue_file_specified_; -} - -inline void options:: -txt_prologue_file_specified (bool x) -{ - this->txt_prologue_file_specified_ = x; -} - -inline const std::string& options:: -hxx_epilogue_file () const -{ - return this->hxx_epilogue_file_; -} - -inline std::string& options:: -hxx_epilogue_file () -{ - return this->hxx_epilogue_file_; -} - -inline void options:: -hxx_epilogue_file (const std::string& x) -{ - this->hxx_epilogue_file_ = x; -} - -inline bool options:: -hxx_epilogue_file_specified () const -{ - return this->hxx_epilogue_file_specified_; -} - -inline void options:: -hxx_epilogue_file_specified (bool x) -{ - this->hxx_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -ixx_epilogue_file () const -{ - return this->ixx_epilogue_file_; -} - -inline std::string& options:: -ixx_epilogue_file () -{ - return this->ixx_epilogue_file_; -} - -inline void options:: -ixx_epilogue_file (const std::string& x) -{ - this->ixx_epilogue_file_ = x; -} - -inline bool options:: -ixx_epilogue_file_specified () const -{ - return this->ixx_epilogue_file_specified_; -} - -inline void options:: -ixx_epilogue_file_specified (bool x) -{ - this->ixx_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -cxx_epilogue_file () const -{ - return this->cxx_epilogue_file_; -} - -inline std::string& options:: -cxx_epilogue_file () -{ - return this->cxx_epilogue_file_; -} - -inline void options:: -cxx_epilogue_file (const std::string& x) -{ - this->cxx_epilogue_file_ = x; -} - -inline bool options:: -cxx_epilogue_file_specified () const -{ - return this->cxx_epilogue_file_specified_; -} - -inline void options:: -cxx_epilogue_file_specified (bool x) -{ - this->cxx_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -man_epilogue_file () const -{ - return this->man_epilogue_file_; -} - -inline std::string& options:: -man_epilogue_file () -{ - return this->man_epilogue_file_; -} - -inline void options:: -man_epilogue_file (const std::string& x) -{ - this->man_epilogue_file_ = x; -} - -inline bool options:: -man_epilogue_file_specified () const -{ - return this->man_epilogue_file_specified_; -} - -inline void options:: -man_epilogue_file_specified (bool x) -{ - this->man_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -html_epilogue_file () const -{ - return this->html_epilogue_file_; -} - -inline std::string& options:: -html_epilogue_file () -{ - return this->html_epilogue_file_; -} - -inline void options:: -html_epilogue_file (const std::string& x) -{ - this->html_epilogue_file_ = x; -} - -inline bool options:: -html_epilogue_file_specified () const -{ - return this->html_epilogue_file_specified_; -} - -inline void options:: -html_epilogue_file_specified (bool x) -{ - this->html_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -txt_epilogue_file () const -{ - return this->txt_epilogue_file_; -} - -inline std::string& options:: -txt_epilogue_file () -{ - return this->txt_epilogue_file_; -} - -inline void options:: -txt_epilogue_file (const std::string& x) -{ - this->txt_epilogue_file_ = x; -} - -inline bool options:: -txt_epilogue_file_specified () const -{ - return this->txt_epilogue_file_specified_; -} - -inline void options:: -txt_epilogue_file_specified (bool x) -{ - this->txt_epilogue_file_specified_ = x; -} - -inline const std::string& options:: -output_prefix () const -{ - return this->output_prefix_; -} - -inline std::string& options:: -output_prefix () -{ - return this->output_prefix_; -} - -inline void options:: -output_prefix (const std::string& x) -{ - this->output_prefix_ = x; -} - -inline bool options:: -output_prefix_specified () const -{ - return this->output_prefix_specified_; -} - -inline void options:: -output_prefix_specified (bool x) -{ - this->output_prefix_specified_ = x; -} - -inline const std::string& options:: -output_suffix () const -{ - return this->output_suffix_; -} - -inline std::string& options:: -output_suffix () -{ - return this->output_suffix_; -} - -inline void options:: -output_suffix (const std::string& x) -{ - this->output_suffix_ = x; -} - -inline bool options:: -output_suffix_specified () const -{ - return this->output_suffix_specified_; -} - -inline void options:: -output_suffix_specified (bool x) -{ - this->output_suffix_specified_ = x; -} - -inline const std::string& options:: -hxx_suffix () const -{ - return this->hxx_suffix_; -} - -inline std::string& options:: -hxx_suffix () -{ - return this->hxx_suffix_; -} - -inline void options:: -hxx_suffix (const std::string& x) -{ - this->hxx_suffix_ = x; -} - -inline bool options:: -hxx_suffix_specified () const -{ - return this->hxx_suffix_specified_; -} - -inline void options:: -hxx_suffix_specified (bool x) -{ - this->hxx_suffix_specified_ = x; -} - -inline const std::string& options:: -ixx_suffix () const -{ - return this->ixx_suffix_; -} - -inline std::string& options:: -ixx_suffix () -{ - return this->ixx_suffix_; -} - -inline void options:: -ixx_suffix (const std::string& x) -{ - this->ixx_suffix_ = x; -} - -inline bool options:: -ixx_suffix_specified () const -{ - return this->ixx_suffix_specified_; -} - -inline void options:: -ixx_suffix_specified (bool x) -{ - this->ixx_suffix_specified_ = x; -} - -inline const std::string& options:: -cxx_suffix () const -{ - return this->cxx_suffix_; -} - -inline std::string& options:: -cxx_suffix () -{ - return this->cxx_suffix_; -} - -inline void options:: -cxx_suffix (const std::string& x) -{ - this->cxx_suffix_ = x; -} - -inline bool options:: -cxx_suffix_specified () const -{ - return this->cxx_suffix_specified_; -} - -inline void options:: -cxx_suffix_specified (bool x) -{ - this->cxx_suffix_specified_ = x; -} - -inline const std::string& options:: -man_suffix () const -{ - return this->man_suffix_; -} - -inline std::string& options:: -man_suffix () -{ - return this->man_suffix_; -} - -inline void options:: -man_suffix (const std::string& x) -{ - this->man_suffix_ = x; -} - -inline bool options:: -man_suffix_specified () const -{ - return this->man_suffix_specified_; -} - -inline void options:: -man_suffix_specified (bool x) -{ - this->man_suffix_specified_ = x; -} - -inline const std::string& options:: -html_suffix () const -{ - return this->html_suffix_; -} - -inline std::string& options:: -html_suffix () -{ - return this->html_suffix_; -} - -inline void options:: -html_suffix (const std::string& x) -{ - this->html_suffix_ = x; -} - -inline bool options:: -html_suffix_specified () const -{ - return this->html_suffix_specified_; -} - -inline void options:: -html_suffix_specified (bool x) -{ - this->html_suffix_specified_ = x; -} - -inline const std::string& options:: -txt_suffix () const -{ - return this->txt_suffix_; -} - -inline std::string& options:: -txt_suffix () -{ - return this->txt_suffix_; -} - -inline void options:: -txt_suffix (const std::string& x) -{ - this->txt_suffix_ = x; -} - -inline bool options:: -txt_suffix_specified () const -{ - return this->txt_suffix_specified_; -} - -inline void options:: -txt_suffix_specified (bool x) -{ - this->txt_suffix_specified_ = x; -} - -inline const std::string& options:: -option_prefix () const -{ - return this->option_prefix_; -} - -inline std::string& options:: -option_prefix () -{ - return this->option_prefix_; -} - -inline void options:: -option_prefix (const std::string& x) -{ - this->option_prefix_ = x; -} - -inline bool options:: -option_prefix_specified () const -{ - return this->option_prefix_specified_; -} - -inline void options:: -option_prefix_specified (bool x) -{ - this->option_prefix_specified_ = x; -} - -inline const std::string& options:: -option_separator () const -{ - return this->option_separator_; -} - -inline std::string& options:: -option_separator () -{ - return this->option_separator_; -} - -inline void options:: -option_separator (const std::string& x) -{ - this->option_separator_ = x; -} - -inline bool options:: -option_separator_specified () const -{ - return this->option_separator_specified_; -} - -inline void options:: -option_separator_specified (bool x) -{ - this->option_separator_specified_ = x; -} - -inline const bool& options:: -keep_separator () const -{ - return this->keep_separator_; -} - -inline bool& options:: -keep_separator () -{ - return this->keep_separator_; -} - -inline void options:: -keep_separator (const bool& x) -{ - this->keep_separator_ = x; -} - -inline const bool& options:: -no_combined_flags () const -{ - return this->no_combined_flags_; -} - -inline bool& options:: -no_combined_flags () -{ - return this->no_combined_flags_; -} - -inline void options:: -no_combined_flags (const bool& x) -{ - this->no_combined_flags_ = x; -} - -inline const bool& options:: -no_combined_values () const -{ - return this->no_combined_values_; -} - -inline bool& options:: -no_combined_values () -{ - return this->no_combined_values_; -} - -inline void options:: -no_combined_values (const bool& x) -{ - this->no_combined_values_ = x; -} - -inline const bool& options:: -include_with_brackets () const -{ - return this->include_with_brackets_; -} - -inline bool& options:: -include_with_brackets () -{ - return this->include_with_brackets_; -} - -inline void options:: -include_with_brackets (const bool& x) -{ - this->include_with_brackets_ = x; -} - -inline const std::string& options:: -include_prefix () const -{ - return this->include_prefix_; -} - -inline std::string& options:: -include_prefix () -{ - return this->include_prefix_; -} - -inline void options:: -include_prefix (const std::string& x) -{ - this->include_prefix_ = x; -} - -inline bool options:: -include_prefix_specified () const -{ - return this->include_prefix_specified_; -} - -inline void options:: -include_prefix_specified (bool x) -{ - this->include_prefix_specified_ = x; -} - -inline const std::string& options:: -guard_prefix () const -{ - return this->guard_prefix_; -} - -inline std::string& options:: -guard_prefix () -{ - return this->guard_prefix_; -} - -inline void options:: -guard_prefix (const std::string& x) -{ - this->guard_prefix_ = x; -} - -inline bool options:: -guard_prefix_specified () const -{ - return this->guard_prefix_specified_; -} - -inline void options:: -guard_prefix_specified (bool x) -{ - this->guard_prefix_specified_ = x; -} - -inline const std::map& options:: -reserved_name () const -{ - return this->reserved_name_; -} - -inline std::map& options:: -reserved_name () -{ - return this->reserved_name_; -} - -inline void options:: -reserved_name (const std::map& x) -{ - this->reserved_name_ = x; -} - -inline bool options:: -reserved_name_specified () const -{ - return this->reserved_name_specified_; -} - -inline void options:: -reserved_name_specified (bool x) -{ - this->reserved_name_specified_ = x; -} - -inline const std::string& options:: -options_file () const -{ - return this->options_file_; -} - -inline std::string& options:: -options_file () -{ - return this->options_file_; -} - -inline void options:: -options_file (const std::string& x) -{ - this->options_file_ = x; -} - -inline bool options:: -options_file_specified () const -{ - return this->options_file_specified_; -} - -inline void options:: -options_file_specified (bool x) -{ - this->options_file_specified_ = x; -} - -// Begin epilogue. -// -// -// End epilogue. diff --git a/cli/cli/buildfile b/cli/cli/buildfile index dc5d75b..4e51ea5 100644 --- a/cli/cli/buildfile +++ b/cli/cli/buildfile @@ -25,91 +25,118 @@ libue{cli}: $hdr $src $all_s $all_t {hxx}{version} $libs hxx{version}: in{version} $src_root/manifest -# Build options (both bootstrap and final version). +# Build options (apply to both bootstrap and final version). # cxx.poptions =+ "-I$out_root" "-I$src_root" +# CLI uses its own generated code to handle the command line. To solve the +# chicken and egg problem that this poses we keep pregenerated source code in +# pregenerated/. +# +# In the consumption build ($config.cli.develop == false), we just use this +# pregenerated source code to build the final version of the compiler. In the +# development build ($config.cli.develop == true) we use this pregenerated +# source code to build a bootstrap version of the compiler which we then use +# to regenerate the source code and build that final version from that. + +## Consumption build ($develop == false). +# + +# Use pregenerated versions to build the final version of cli. +# +libue{cli}: pregenerated/{hxx ixx cxx}{**}: include = (!$develop) + +if! $develop + cxx.poptions =+ "-I($src_base/pregenerated)" # Note: must come first. + +# Distribute pregenerated versions only in the consumption build. +# +pregenerated/{hxx ixx cxx}{*}: dist = (!$develop) + +# +## + +## Development build ($develop == true). +# +libue{cli}: {hxx ixx cxx}{options}: include = $develop + # Bootstrap. # # The plan is as follows: # # 1. Build the bootstrap version of cli using a copy of options.?xx saved in -# bootstrap/cli/. +# pregenerated/cli/. # -# 2. Use that to re-generate options.?xx. If the result differs from the -# saved version, copy it over and fail the build, asking for a restart. +# 2. Use that to regenerate options.?xx. If the result differs from the saved +# version, copy it over and fail the build, asking for a restart. # -# 3. Otherwise, proceed to build the final version of cli. +# 3. Otherwise, proceed to build the final version of cli using regenerated +# options.?xx. # -if $config.cli.develop +pregenerated/ { - libue{cli}: {hxx ixx cxx}{options} + # This should only apply to the bootstrap build. + # + cxx.poptions =+ "-I$src_base" # Note: must come first. - bootstrap/ + cli/ { - # This should only apply to the bootstrap build. + # Note: semantics/ and traversal/ do not include options.hxx so we can + # share their object files. # - cxx.poptions =+ "-I$src_base" # Note: must come first. - - cli/ - { - # Note: semantics/ and traversal/ do not include options.hxx so we can - # share their object files. - # - exe{cli}: obj{cli $name($src) options} ../../{$all_s $all_t} $libs + exe{cli}: obj{cli $name($src) options} ../../{$all_s $all_t} $libs - for s: cli $name($src) - obj{$s}: ../../cxx{$s} $libs + for s: cli $name($src) + obj{$s}: ../../cxx{$s} $libs - obj{options}: {hxx ixx cxx}{options} + obj{options}: {hxx ixx cxx}{options} - obj{cli}: cxx.poptions += -DCLI_BOOTSTRAP - } + obj{cli}: cxx.poptions += -DCLI_BOOTSTRAP } +} - <{hxx ixx cxx}{options}>: cli{options} bootstrap/cli/exe{cli} - { - options = --include-with-brackets --include-prefix cli \ - --guard-prefix CLI --generate-file-scanner \ - --generate-specifier --generate-modifier \ - --suppress-undocumented --reserved-name stdout +# In the development build distribute regenerated {hxx ixx cxx}{options}, +# remapping their locations to the paths of the pregenerated versions (which +# are only distributed in the consumption build; see above). This way we make +# sure that the distributed files are always up-to-date. +# +<{hxx ixx cxx}{options}>: cli{options} pregenerated/cli/exe{cli} +{ + options = --include-with-brackets --include-prefix cli \ + --guard-prefix CLI --generate-file-scanner \ + --generate-specifier --generate-modifier \ + --suppress-undocumented --reserved-name stdout - # Symlink the generated code in src for convenience of development. - # - backlink = true - } - {{ - diag cli ($<[0]) - ($<[1]) $options -o $out_base $path($<[0]) + dist = ($develop ? pregenerated/cli/ : false) - # If the result differs from the bootstrap version, copy it over and - # request the build restart. - # - if diff $src_base/bootstrap/cli/options.hxx $path($>[0]) >- && \ - diff $src_base/bootstrap/cli/options.ixx $path($>[1]) >- && \ - diff $src_base/bootstrap/cli/options.cxx $path($>[2]) >- - exit - end - - cp $path($>[0]) $src_base/bootstrap/cli/options.hxx - cp $path($>[1]) $src_base/bootstrap/cli/options.ixx - cp $path($>[2]) $src_base/bootstrap/cli/options.cxx - - exit "bootstrap options.?xx have changed, restart the build" - }} + # Symlink the generated code in src for convenience of development. + # + backlink = true } -else -{ - # Use bootstrap options.?xx to build the final version of cli. +% +if $develop +{{ + diag cli ($<[0]) + ($<[1]) $options -o $out_base $path($<[0]) + + # If the result differs from the bootstrap version, copy it over and + # request the build restart. # - libue{cli}: bootstrap/cli/{hxx ixx cxx}{options} - cxx.poptions =+ "-I($src_base/bootstrap)" # Note: must come first. + if diff $src_base/pregenerated/cli/options.hxx $path($>[0]) >- && \ + diff $src_base/pregenerated/cli/options.ixx $path($>[1]) >- && \ + diff $src_base/pregenerated/cli/options.cxx $path($>[2]) >- + exit + end - ./: cli{options} # Keep in distribution. -} + cp $path($>[0]) $src_base/pregenerated/cli/options.hxx + cp $path($>[1]) $src_base/pregenerated/cli/options.ixx + cp $path($>[2]) $src_base/pregenerated/cli/options.cxx + + exit "bootstrap options.?xx have changed, restart the build" +}} -# Build options (final version only). # +## # Pass the copyright notice extracted from the LICENSE file. # diff --git a/cli/cli/pregenerated/cli/options.cxx b/cli/cli/pregenerated/cli/options.cxx new file mode 100644 index 0000000..2cb2f75 --- /dev/null +++ b/cli/cli/pregenerated/cli/options.cxx @@ -0,0 +1,2258 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +// +// End prologue. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cli +{ + // unknown_option + // + unknown_option:: + ~unknown_option () throw () + { + } + + void unknown_option:: + print (::std::ostream& os) const + { + os << "unknown option '" << option ().c_str () << "'"; + } + + const char* unknown_option:: + what () const throw () + { + return "unknown option"; + } + + // unknown_argument + // + unknown_argument:: + ~unknown_argument () throw () + { + } + + void unknown_argument:: + print (::std::ostream& os) const + { + os << "unknown argument '" << argument ().c_str () << "'"; + } + + const char* unknown_argument:: + what () const throw () + { + return "unknown argument"; + } + + // missing_value + // + missing_value:: + ~missing_value () throw () + { + } + + void missing_value:: + print (::std::ostream& os) const + { + os << "missing value for option '" << option ().c_str () << "'"; + } + + const char* missing_value:: + what () const throw () + { + return "missing option value"; + } + + // invalid_value + // + invalid_value:: + ~invalid_value () throw () + { + } + + void invalid_value:: + print (::std::ostream& os) const + { + os << "invalid value '" << value ().c_str () << "' for option '" + << option ().c_str () << "'"; + + if (!message ().empty ()) + os << ": " << message ().c_str (); + } + + const char* invalid_value:: + what () const throw () + { + return "invalid option value"; + } + + // eos_reached + // + void eos_reached:: + print (::std::ostream& os) const + { + os << what (); + } + + const char* eos_reached:: + what () const throw () + { + return "end of argument stream reached"; + } + + // file_io_failure + // + file_io_failure:: + ~file_io_failure () throw () + { + } + + void file_io_failure:: + print (::std::ostream& os) const + { + os << "unable to open file '" << file ().c_str () << "' or read failure"; + } + + const char* file_io_failure:: + what () const throw () + { + return "unable to open file or read failure"; + } + + // unmatched_quote + // + unmatched_quote:: + ~unmatched_quote () throw () + { + } + + void unmatched_quote:: + print (::std::ostream& os) const + { + os << "unmatched quote in argument '" << argument ().c_str () << "'"; + } + + const char* unmatched_quote:: + what () const throw () + { + return "unmatched quote"; + } + + // scanner + // + scanner:: + ~scanner () + { + } + + // argv_scanner + // + bool argv_scanner:: + more () + { + return i_ < argc_; + } + + const char* argv_scanner:: + peek () + { + if (i_ < argc_) + return argv_[i_]; + else + throw eos_reached (); + } + + const char* argv_scanner:: + next () + { + if (i_ < argc_) + { + const char* r (argv_[i_]); + + if (erase_) + { + for (int i (i_ + 1); i < argc_; ++i) + argv_[i - 1] = argv_[i]; + + --argc_; + argv_[argc_] = 0; + } + else + ++i_; + + ++start_position_; + return r; + } + else + throw eos_reached (); + } + + void argv_scanner:: + skip () + { + if (i_ < argc_) + { + ++i_; + ++start_position_; + } + else + throw eos_reached (); + } + + std::size_t argv_scanner:: + position () + { + return start_position_; + } + + // argv_file_scanner + // + int argv_file_scanner::zero_argc_ = 0; + std::string argv_file_scanner::empty_string_; + + bool argv_file_scanner:: + more () + { + if (!args_.empty ()) + return true; + + while (base::more ()) + { + // See if the next argument is the file option. + // + const char* a (base::peek ()); + const option_info* oi = 0; + const char* ov = 0; + + if (!skip_) + { + if ((oi = find (a)) != 0) + { + base::next (); + + if (!base::more ()) + throw missing_value (a); + + ov = base::next (); + } + else if (std::strncmp (a, "-", 1) == 0) + { + if ((ov = std::strchr (a, '=')) != 0) + { + std::string o (a, 0, ov - a); + if ((oi = find (o.c_str ())) != 0) + { + base::next (); + ++ov; + } + } + } + } + + if (oi != 0) + { + if (oi->search_func != 0) + { + std::string f (oi->search_func (ov, oi->arg)); + + if (!f.empty ()) + load (f); + } + else + load (ov); + + if (!args_.empty ()) + return true; + } + else + { + if (!skip_) + skip_ = (std::strcmp (a, "--") == 0); + + return true; + } + } + + return false; + } + + const char* argv_file_scanner:: + peek () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? base::peek () : args_.front ().value.c_str (); + } + + const std::string& argv_file_scanner:: + peek_file () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? empty_string_ : *args_.front ().file; + } + + std::size_t argv_file_scanner:: + peek_line () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? 0 : args_.front ().line; + } + + const char* argv_file_scanner:: + next () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::next (); + else + { + hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ().value); + args_.pop_front (); + ++start_position_; + return hold_[i_].c_str (); + } + } + + void argv_file_scanner:: + skip () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::skip (); + else + { + args_.pop_front (); + ++start_position_; + } + } + + const argv_file_scanner::option_info* argv_file_scanner:: + find (const char* a) const + { + for (std::size_t i (0); i < options_count_; ++i) + if (std::strcmp (a, options_[i].option) == 0) + return &options_[i]; + + return 0; + } + + std::size_t argv_file_scanner:: + position () + { + return start_position_; + } + + void argv_file_scanner:: + load (const std::string& file) + { + using namespace std; + + ifstream is (file.c_str ()); + + if (!is.is_open ()) + throw file_io_failure (file); + + files_.push_back (file); + + arg a; + a.file = &*files_.rbegin (); + + for (a.line = 1; !is.eof (); ++a.line) + { + string line; + getline (is, line); + + if (is.fail () && !is.eof ()) + throw file_io_failure (file); + + string::size_type n (line.size ()); + + // Trim the line from leading and trailing whitespaces. + // + if (n != 0) + { + const char* f (line.c_str ()); + const char* l (f + n); + + const char* of (f); + while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) + ++f; + + --l; + + const char* ol (l); + while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) + --l; + + if (f != of || l != ol) + line = f <= l ? string (f, l - f + 1) : string (); + } + + // Ignore empty lines, those that start with #. + // + if (line.empty () || line[0] == '#') + continue; + + string::size_type p (string::npos); + if (line.compare (0, 1, "-") == 0) + { + p = line.find (' '); + + string::size_type q (line.find ('=')); + if (q != string::npos && q < p) + p = q; + } + + string s1; + if (p != string::npos) + { + s1.assign (line, 0, p); + + // Skip leading whitespaces in the argument. + // + if (line[p] == '=') + ++p; + else + { + n = line.size (); + for (++p; p < n; ++p) + { + char c (line[p]); + if (c != ' ' && c != '\t' && c != '\r') + break; + } + } + } + else if (!skip_) + skip_ = (line == "--"); + + string s2 (line, p != string::npos ? p : 0); + + // If the string (which is an option value or argument) is + // wrapped in quotes, remove them. + // + n = s2.size (); + char cf (s2[0]), cl (s2[n - 1]); + + if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') + { + if (n == 1 || cf != cl) + throw unmatched_quote (s2); + + s2 = string (s2, 1, n - 2); + } + + if (!s1.empty ()) + { + // See if this is another file option. + // + const option_info* oi; + if (!skip_ && (oi = find (s1.c_str ()))) + { + if (s2.empty ()) + throw missing_value (oi->option); + + if (oi->search_func != 0) + { + string f (oi->search_func (s2.c_str (), oi->arg)); + if (!f.empty ()) + load (f); + } + else + { + // If the path of the file being parsed is not simple and the + // path of the file that needs to be loaded is relative, then + // complete the latter using the former as a base. + // +#ifndef _WIN32 + string::size_type p (file.find_last_of ('/')); + bool c (p != string::npos && s2[0] != '/'); +#else + string::size_type p (file.find_last_of ("/\\")); + bool c (p != string::npos && s2[1] != ':'); +#endif + if (c) + s2.insert (0, file, 0, p + 1); + + load (s2); + } + + continue; + } + + a.value = s1; + args_.push_back (a); + } + + a.value = s2; + args_.push_back (a); + } + } + + template + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + using namespace std; + + const char* o (s.next ()); + if (s.more ()) + { + string v (s.next ()); + istringstream is (v); + if (!(is >> x && is.peek () == istringstream::traits_type::eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser + { + static void + parse (bool& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + + if (std::strcmp (v, "1") == 0 || + std::strcmp (v, "true") == 0 || + std::strcmp (v, "TRUE") == 0 || + std::strcmp (v, "True") == 0) + x = true; + else if (std::strcmp (v, "0") == 0 || + std::strcmp (v, "false") == 0 || + std::strcmp (v, "FALSE") == 0 || + std::strcmp (v, "False") == 0) + x = false; + else + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::pair& x, bool& xs, scanner& s) + { + x.second = s.position (); + parser::parse (x.first, xs, s); + } + }; + + template + struct parser > + { + static void + parse (std::vector& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser::parse (x, dummy, s); + c.push_back (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::set& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser::parse (x, dummy, s); + c.insert (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::map& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (v, dummy, s); + } + + m[k] = v; + } + else + throw missing_value (o); + + xs = true; + } + }; + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, s); + } + + template + void + thunk (X& x, scanner& s) + { + s.next (); + x.*M = true; + } + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, x.*S, s); + } +} + +#include + +// options +// + +options:: +options () +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ +} + +options:: +options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); +} + +options:: +options (int start, + int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); +} + +options:: +options (int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); +} + +options:: +options (int start, + int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); +} + +options:: +options (::cli::scanner& s, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), + version_ (), + include_path_ (), + include_path_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + std_ (cxx_version::cxx98), + std_specified_ (false), + generate_modifier_ (), + generate_specifier_ (), + generate_parse_ (), + generate_merge_ (), + generate_description_ (), + generate_file_scanner_ (), + generate_vector_scanner_ (), + generate_group_scanner_ (), + suppress_inline_ (), + suppress_cli_ (), + cli_namespace_ ("::cli"), + cli_namespace_specified_ (false), + ostream_type_ ("::std::ostream"), + ostream_type_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + generate_cxx_ (), + generate_man_ (), + generate_html_ (), + generate_txt_ (), + stdout__ (), + suppress_undocumented_ (), + suppress_usage_ (), + long_usage_ (), + short_usage_ (), + page_usage_ (), + page_usage_specified_ (false), + option_length_ (0), + option_length_specified_ (false), + ascii_tree_ (), + ansi_color_ (), + exclude_base_ (), + include_base_last_ (), + class_doc_ (), + class_doc_specified_ (false), + class__ (), + class__specified_ (false), + docvar_ (), + docvar_specified_ (false), + link_regex_ (), + link_regex_specified_ (false), + link_regex_trace_ (), + html_heading_map_ (), + html_heading_map_specified_ (false), + omit_link_check_ (), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + man_prologue_ (), + man_prologue_specified_ (false), + html_prologue_ (), + html_prologue_specified_ (false), + txt_prologue_ (), + txt_prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + man_epilogue_ (), + man_epilogue_specified_ (false), + html_epilogue_ (), + html_epilogue_specified_ (false), + txt_epilogue_ (), + txt_epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + man_prologue_file_ (), + man_prologue_file_specified_ (false), + html_prologue_file_ (), + html_prologue_file_specified_ (false), + txt_prologue_file_ (), + txt_prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + man_epilogue_file_ (), + man_epilogue_file_specified_ (false), + html_epilogue_file_ (), + html_epilogue_file_specified_ (false), + txt_epilogue_file_ (), + txt_epilogue_file_specified_ (false), + output_prefix_ (), + output_prefix_specified_ (false), + output_suffix_ (), + output_suffix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + man_suffix_ (".1"), + man_suffix_specified_ (false), + html_suffix_ (".html"), + html_suffix_specified_ (false), + txt_suffix_ (".txt"), + txt_suffix_specified_ (false), + option_prefix_ ("-"), + option_prefix_specified_ (false), + option_separator_ ("--"), + option_separator_specified_ (false), + keep_separator_ (), + no_combined_flags_ (), + no_combined_values_ (), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + guard_prefix_ (), + guard_prefix_specified_ (false), + reserved_name_ (), + reserved_name_specified_ (false), + options_file_ (), + options_file_specified_ (false) +{ + _parse (s, opt, arg); +} + +::cli::usage_para options:: +print_usage (::std::ostream& os, ::cli::usage_para p) +{ + CLI_POTENTIALLY_UNUSED (os); + + if (p == ::cli::usage_para::text) + os << ::std::endl; + + os << "--help Print usage information and exit." << ::std::endl; + + os << "--version Print version and exit." << ::std::endl; + + os << "--include-path|-I Search for bracket-included (<>) options" << ::std::endl + << " files." << ::std::endl; + + os << "--output-dir|-o Write the generated files to instead of the" << ::std::endl + << " current directory." << ::std::endl; + + os << "--std 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; + + 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-merge Generate merge() functions." << ::std::endl; + + os << "--generate-description Generate the option description list that can be" << ::std::endl + << " examined at runtime." << ::std::endl; + + os << "--generate-file-scanner Generate the argv_file_scanner implementation." << ::std::endl; + + os << "--generate-vector-scanner Generate the vector_scanner implementation." << ::std::endl; + + os << "--generate-group-scanner Generate the group_scanner implementation." << ::std::endl; + + os << "--suppress-inline Generate all functions non-inline." << ::std::endl; + + os << "--suppress-cli Do not generate the CLI support types (scanners," << ::std::endl + << " parser, etc)." << ::std::endl; + + os << "--cli-namespace Generate the CLI support types in the " << ::std::endl + << " namespace (cli by default)." << ::std::endl; + + os << "--ostream-type Output stream type instead of the default" << ::std::endl + << " std::ostream that should be used to print usage" << ::std::endl + << " and exception information." << ::std::endl; + + os << "--export-symbol Insert in places where DLL export/import" << ::std::endl + << " control statements" << ::std::endl + << " (__declspec(dllexport/dllimport)) are necessary." << ::std::endl; + + os << "--generate-cxx Generate C++ code." << ::std::endl; + + os << "--generate-man Generate documentation in the man page format." << ::std::endl; + + os << "--generate-html Generate documentation in the HTML format." << ::std::endl; + + os << "--generate-txt Generate documentation in the plain text format," << ::std::endl + << " similar to usage." << ::std::endl; + + os << "--stdout Write output to STDOUT instead of a file." << ::std::endl; + + os << "--suppress-undocumented Suppress the generation of documentation entries" << ::std::endl + << " for undocumented options." << ::std::endl; + + os << "--suppress-usage Suppress the generation of the usage printing" << ::std::endl + << " code." << ::std::endl; + + os << "--long-usage If no short documentation string is provided, use" << ::std::endl + << " the complete long documentation string in usage." << ::std::endl; + + os << "--short-usage If specified together with --long-usage, generate" << ::std::endl + << " both short and long usage versions." << ::std::endl; + + os << "--page-usage Generate the combined usage printing code for the" << ::std::endl + << " entire page." << ::std::endl; + + os << "--option-length Indent option descriptions characters when" << ::std::endl + << " printing usage." << ::std::endl; + + os << "--ascii-tree Convert UTF-8 tree(1) output to ASCII." << ::std::endl; + + os << "--ansi-color Use ANSI color escape sequences when printing" << ::std::endl + << " usage." << ::std::endl; + + os << "--exclude-base Exclude base class information from usage and" << ::std::endl + << " documentation." << ::std::endl; + + os << "--include-base-last Include base class information after derived for" << ::std::endl + << " usage and documentation." << ::std::endl; + + os << "--class-doc = Specify the documentation that should be" << ::std::endl + << " used for the options class ." << ::std::endl; + + os << "--class Generate the man page, HTML, or text documentation" << ::std::endl + << " only for the options class ." << ::std::endl; + + os << "--docvar|-v = Set documentation variable to the value" << ::std::endl + << " ." << ::std::endl; + + os << "--link-regex Add to the list of regular expressions" << ::std::endl + << " used to transform link targets in the generated" << ::std::endl + << " documentation." << ::std::endl; + + os << "--link-regex-trace Trace the process of applying regular expressions" << ::std::endl + << " specified with the --link-regex option." << ::std::endl; + + os << "--html-heading-map = Map CLI heading (valid values: 'H', '0', '1'," << ::std::endl + << " 'h', and '2') to HTML heading (for example," << ::std::endl + << " 'h1', 'h2', etc)." << ::std::endl; + + os << "--omit-link-check Don't check that local fragment link references" << ::std::endl + << " (\\l{#ref ...}) resolve to ids." << ::std::endl; + + os << "--hxx-prologue Insert at the beginning of the generated" << ::std::endl + << " C++ header file." << ::std::endl; + + os << "--ixx-prologue Insert at the beginning of the generated" << ::std::endl + << " C++ inline file." << ::std::endl; + + os << "--cxx-prologue Insert at the beginning of the generated" << ::std::endl + << " C++ source file." << ::std::endl; + + os << "--man-prologue Insert at the beginning of the generated" << ::std::endl + << " man page file." << ::std::endl; + + os << "--html-prologue Insert at the beginning of the generated" << ::std::endl + << " HTML file." << ::std::endl; + + os << "--txt-prologue Insert at the beginning of the generated" << ::std::endl + << " text file." << ::std::endl; + + os << "--hxx-epilogue Insert at the end of the generated C++" << ::std::endl + << " header file." << ::std::endl; + + os << "--ixx-epilogue Insert at the end of the generated C++" << ::std::endl + << " inline file." << ::std::endl; + + os << "--cxx-epilogue Insert at the end of the generated C++" << ::std::endl + << " source file." << ::std::endl; + + os << "--man-epilogue Insert at the end of the generated man page" << ::std::endl + << " file." << ::std::endl; + + os << "--html-epilogue Insert at the end of the generated HTML" << ::std::endl + << " file." << ::std::endl; + + os << "--txt-epilogue Insert at the end of the generated text" << ::std::endl + << " file." << ::std::endl; + + os << "--hxx-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated C++ header file." << ::std::endl; + + os << "--ixx-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated C++ inline file." << ::std::endl; + + os << "--cxx-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated C++ source file." << ::std::endl; + + os << "--man-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated man page file." << ::std::endl; + + os << "--html-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated HTML file." << ::std::endl; + + os << "--txt-prologue-file Insert the content of at the beginning of" << ::std::endl + << " the generated text file." << ::std::endl; + + os << "--hxx-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated C++ header file." << ::std::endl; + + os << "--ixx-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated C++ inline file." << ::std::endl; + + os << "--cxx-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated C++ source file." << ::std::endl; + + os << "--man-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated man page file." << ::std::endl; + + os << "--html-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated HTML file." << ::std::endl; + + os << "--txt-epilogue-file Insert the content of at the end of the" << ::std::endl + << " generated text file." << ::std::endl; + + os << "--output-prefix Add at the beginning of the generated" << ::std::endl + << " output file name(s)." << ::std::endl; + + os << "--output-suffix Add at the end of the generated output" << ::std::endl + << " file name(s)." << ::std::endl; + + os << "--hxx-suffix Use instead of the default .hxx to" << ::std::endl + << " construct the name of the generated header file." << ::std::endl; + + os << "--ixx-suffix Use instead of the default .ixx to" << ::std::endl + << " construct the name of the generated inline file." << ::std::endl; + + os << "--cxx-suffix Use instead of the default .cxx to" << ::std::endl + << " construct the name of the generated source file." << ::std::endl; + + os << "--man-suffix Use instead of the default .1 to" << ::std::endl + << " construct the name of the generated man page file." << ::std::endl; + + os << "--html-suffix Use instead of the default .html to" << ::std::endl + << " construct the name of the generated HTML file." << ::std::endl; + + os << "--txt-suffix Use instead of the default .txt to" << ::std::endl + << " construct the name of the generated text file." << ::std::endl; + + os << "--option-prefix Use instead of the default '-' as an" << ::std::endl + << " option prefix." << ::std::endl; + + os << "--option-separator Use instead of the default '--' as an" << ::std::endl + << " optional separator between options and arguments." << ::std::endl; + + os << "--keep-separator Leave the option separator in the scanner." << ::std::endl; + + os << "--no-combined-flags Disable support for combining multiple" << ::std::endl + << " single-character flags into a single argument (the" << ::std::endl + << " -xyz form that is equivalent to -x -y -z)." << ::std::endl; + + os << "--no-combined-values Disable support for combining an option and its" << ::std::endl + << " value into a single argument with the assignment" << ::std::endl + << " sign (the option=value form)." << ::std::endl; + + os << "--include-with-brackets Use angle brackets (<>) instead of quotes (\"\") in" << ::std::endl + << " the generated #include directives." << ::std::endl; + + os << "--include-prefix Add to the generated #include directive" << ::std::endl + << " paths." << ::std::endl; + + os << "--guard-prefix Add to the generated header inclusion" << ::std::endl + << " guards." << ::std::endl; + + os << "--reserved-name = Add with an optional replacement to" << ::std::endl + << " the list of names that should not be used as" << ::std::endl + << " identifiers." << ::std::endl; + + os << "--options-file Read additional options from ." << ::std::endl; + + p = ::cli::usage_para::option; + + return p; +} + +typedef +std::map +_cli_options_map; + +static _cli_options_map _cli_options_map_; + +struct _cli_options_map_init +{ + _cli_options_map_init () + { + _cli_options_map_["--build2-metadata"] = + &::cli::thunk< options, std::uint64_t, &options::build2_metadata_, + &options::build2_metadata_specified_ >; + _cli_options_map_["--help"] = + &::cli::thunk< options, &options::help_ >; + _cli_options_map_["--version"] = + &::cli::thunk< options, &options::version_ >; + _cli_options_map_["--include-path"] = + &::cli::thunk< options, std::vector, &options::include_path_, + &options::include_path_specified_ >; + _cli_options_map_["-I"] = + &::cli::thunk< options, std::vector, &options::include_path_, + &options::include_path_specified_ >; + _cli_options_map_["--output-dir"] = + &::cli::thunk< options, std::string, &options::output_dir_, + &options::output_dir_specified_ >; + _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, &options::generate_modifier_ >; + _cli_options_map_["--generate-specifier"] = + &::cli::thunk< options, &options::generate_specifier_ >; + _cli_options_map_["--generate-parse"] = + &::cli::thunk< options, &options::generate_parse_ >; + _cli_options_map_["--generate-merge"] = + &::cli::thunk< options, &options::generate_merge_ >; + _cli_options_map_["--generate-description"] = + &::cli::thunk< options, &options::generate_description_ >; + _cli_options_map_["--generate-file-scanner"] = + &::cli::thunk< options, &options::generate_file_scanner_ >; + _cli_options_map_["--generate-vector-scanner"] = + &::cli::thunk< options, &options::generate_vector_scanner_ >; + _cli_options_map_["--generate-group-scanner"] = + &::cli::thunk< options, &options::generate_group_scanner_ >; + _cli_options_map_["--suppress-inline"] = + &::cli::thunk< options, &options::suppress_inline_ >; + _cli_options_map_["--suppress-cli"] = + &::cli::thunk< options, &options::suppress_cli_ >; + _cli_options_map_["--cli-namespace"] = + &::cli::thunk< options, std::string, &options::cli_namespace_, + &options::cli_namespace_specified_ >; + _cli_options_map_["--ostream-type"] = + &::cli::thunk< options, std::string, &options::ostream_type_, + &options::ostream_type_specified_ >; + _cli_options_map_["--export-symbol"] = + &::cli::thunk< options, std::string, &options::export_symbol_, + &options::export_symbol_specified_ >; + _cli_options_map_["--generate-cxx"] = + &::cli::thunk< options, &options::generate_cxx_ >; + _cli_options_map_["--generate-man"] = + &::cli::thunk< options, &options::generate_man_ >; + _cli_options_map_["--generate-html"] = + &::cli::thunk< options, &options::generate_html_ >; + _cli_options_map_["--generate-txt"] = + &::cli::thunk< options, &options::generate_txt_ >; + _cli_options_map_["--stdout"] = + &::cli::thunk< options, &options::stdout__ >; + _cli_options_map_["--suppress-undocumented"] = + &::cli::thunk< options, &options::suppress_undocumented_ >; + _cli_options_map_["--suppress-usage"] = + &::cli::thunk< options, &options::suppress_usage_ >; + _cli_options_map_["--long-usage"] = + &::cli::thunk< options, &options::long_usage_ >; + _cli_options_map_["--short-usage"] = + &::cli::thunk< options, &options::short_usage_ >; + _cli_options_map_["--page-usage"] = + &::cli::thunk< options, std::string, &options::page_usage_, + &options::page_usage_specified_ >; + _cli_options_map_["--option-length"] = + &::cli::thunk< options, std::size_t, &options::option_length_, + &options::option_length_specified_ >; + _cli_options_map_["--ascii-tree"] = + &::cli::thunk< options, &options::ascii_tree_ >; + _cli_options_map_["--ansi-color"] = + &::cli::thunk< options, &options::ansi_color_ >; + _cli_options_map_["--exclude-base"] = + &::cli::thunk< options, &options::exclude_base_ >; + _cli_options_map_["--include-base-last"] = + &::cli::thunk< options, &options::include_base_last_ >; + _cli_options_map_["--class-doc"] = + &::cli::thunk< options, std::map, &options::class_doc_, + &options::class_doc_specified_ >; + _cli_options_map_["--class"] = + &::cli::thunk< options, std::vector, &options::class__, + &options::class__specified_ >; + _cli_options_map_["--docvar"] = + &::cli::thunk< options, std::map, &options::docvar_, + &options::docvar_specified_ >; + _cli_options_map_["-v"] = + &::cli::thunk< options, std::map, &options::docvar_, + &options::docvar_specified_ >; + _cli_options_map_["--link-regex"] = + &::cli::thunk< options, std::vector, &options::link_regex_, + &options::link_regex_specified_ >; + _cli_options_map_["--link-regex-trace"] = + &::cli::thunk< options, &options::link_regex_trace_ >; + _cli_options_map_["--html-heading-map"] = + &::cli::thunk< options, std::map, &options::html_heading_map_, + &options::html_heading_map_specified_ >; + _cli_options_map_["--omit-link-check"] = + &::cli::thunk< options, &options::omit_link_check_ >; + _cli_options_map_["--hxx-prologue"] = + &::cli::thunk< options, std::vector, &options::hxx_prologue_, + &options::hxx_prologue_specified_ >; + _cli_options_map_["--ixx-prologue"] = + &::cli::thunk< options, std::vector, &options::ixx_prologue_, + &options::ixx_prologue_specified_ >; + _cli_options_map_["--cxx-prologue"] = + &::cli::thunk< options, std::vector, &options::cxx_prologue_, + &options::cxx_prologue_specified_ >; + _cli_options_map_["--man-prologue"] = + &::cli::thunk< options, std::vector, &options::man_prologue_, + &options::man_prologue_specified_ >; + _cli_options_map_["--html-prologue"] = + &::cli::thunk< options, std::vector, &options::html_prologue_, + &options::html_prologue_specified_ >; + _cli_options_map_["--txt-prologue"] = + &::cli::thunk< options, std::vector, &options::txt_prologue_, + &options::txt_prologue_specified_ >; + _cli_options_map_["--hxx-epilogue"] = + &::cli::thunk< options, std::vector, &options::hxx_epilogue_, + &options::hxx_epilogue_specified_ >; + _cli_options_map_["--ixx-epilogue"] = + &::cli::thunk< options, std::vector, &options::ixx_epilogue_, + &options::ixx_epilogue_specified_ >; + _cli_options_map_["--cxx-epilogue"] = + &::cli::thunk< options, std::vector, &options::cxx_epilogue_, + &options::cxx_epilogue_specified_ >; + _cli_options_map_["--man-epilogue"] = + &::cli::thunk< options, std::vector, &options::man_epilogue_, + &options::man_epilogue_specified_ >; + _cli_options_map_["--html-epilogue"] = + &::cli::thunk< options, std::vector, &options::html_epilogue_, + &options::html_epilogue_specified_ >; + _cli_options_map_["--txt-epilogue"] = + &::cli::thunk< options, std::vector, &options::txt_epilogue_, + &options::txt_epilogue_specified_ >; + _cli_options_map_["--hxx-prologue-file"] = + &::cli::thunk< options, std::string, &options::hxx_prologue_file_, + &options::hxx_prologue_file_specified_ >; + _cli_options_map_["--ixx-prologue-file"] = + &::cli::thunk< options, std::string, &options::ixx_prologue_file_, + &options::ixx_prologue_file_specified_ >; + _cli_options_map_["--cxx-prologue-file"] = + &::cli::thunk< options, std::string, &options::cxx_prologue_file_, + &options::cxx_prologue_file_specified_ >; + _cli_options_map_["--man-prologue-file"] = + &::cli::thunk< options, std::string, &options::man_prologue_file_, + &options::man_prologue_file_specified_ >; + _cli_options_map_["--html-prologue-file"] = + &::cli::thunk< options, std::string, &options::html_prologue_file_, + &options::html_prologue_file_specified_ >; + _cli_options_map_["--txt-prologue-file"] = + &::cli::thunk< options, std::string, &options::txt_prologue_file_, + &options::txt_prologue_file_specified_ >; + _cli_options_map_["--hxx-epilogue-file"] = + &::cli::thunk< options, std::string, &options::hxx_epilogue_file_, + &options::hxx_epilogue_file_specified_ >; + _cli_options_map_["--ixx-epilogue-file"] = + &::cli::thunk< options, std::string, &options::ixx_epilogue_file_, + &options::ixx_epilogue_file_specified_ >; + _cli_options_map_["--cxx-epilogue-file"] = + &::cli::thunk< options, std::string, &options::cxx_epilogue_file_, + &options::cxx_epilogue_file_specified_ >; + _cli_options_map_["--man-epilogue-file"] = + &::cli::thunk< options, std::string, &options::man_epilogue_file_, + &options::man_epilogue_file_specified_ >; + _cli_options_map_["--html-epilogue-file"] = + &::cli::thunk< options, std::string, &options::html_epilogue_file_, + &options::html_epilogue_file_specified_ >; + _cli_options_map_["--txt-epilogue-file"] = + &::cli::thunk< options, std::string, &options::txt_epilogue_file_, + &options::txt_epilogue_file_specified_ >; + _cli_options_map_["--output-prefix"] = + &::cli::thunk< options, std::string, &options::output_prefix_, + &options::output_prefix_specified_ >; + _cli_options_map_["--output-suffix"] = + &::cli::thunk< options, std::string, &options::output_suffix_, + &options::output_suffix_specified_ >; + _cli_options_map_["--hxx-suffix"] = + &::cli::thunk< options, std::string, &options::hxx_suffix_, + &options::hxx_suffix_specified_ >; + _cli_options_map_["--ixx-suffix"] = + &::cli::thunk< options, std::string, &options::ixx_suffix_, + &options::ixx_suffix_specified_ >; + _cli_options_map_["--cxx-suffix"] = + &::cli::thunk< options, std::string, &options::cxx_suffix_, + &options::cxx_suffix_specified_ >; + _cli_options_map_["--man-suffix"] = + &::cli::thunk< options, std::string, &options::man_suffix_, + &options::man_suffix_specified_ >; + _cli_options_map_["--html-suffix"] = + &::cli::thunk< options, std::string, &options::html_suffix_, + &options::html_suffix_specified_ >; + _cli_options_map_["--txt-suffix"] = + &::cli::thunk< options, std::string, &options::txt_suffix_, + &options::txt_suffix_specified_ >; + _cli_options_map_["--option-prefix"] = + &::cli::thunk< options, std::string, &options::option_prefix_, + &options::option_prefix_specified_ >; + _cli_options_map_["--option-separator"] = + &::cli::thunk< options, std::string, &options::option_separator_, + &options::option_separator_specified_ >; + _cli_options_map_["--keep-separator"] = + &::cli::thunk< options, &options::keep_separator_ >; + _cli_options_map_["--no-combined-flags"] = + &::cli::thunk< options, &options::no_combined_flags_ >; + _cli_options_map_["--no-combined-values"] = + &::cli::thunk< options, &options::no_combined_values_ >; + _cli_options_map_["--include-with-brackets"] = + &::cli::thunk< options, &options::include_with_brackets_ >; + _cli_options_map_["--include-prefix"] = + &::cli::thunk< options, std::string, &options::include_prefix_, + &options::include_prefix_specified_ >; + _cli_options_map_["--guard-prefix"] = + &::cli::thunk< options, std::string, &options::guard_prefix_, + &options::guard_prefix_specified_ >; + _cli_options_map_["--reserved-name"] = + &::cli::thunk< options, std::map, &options::reserved_name_, + &options::reserved_name_specified_ >; + _cli_options_map_["--options-file"] = + &::cli::thunk< options, std::string, &options::options_file_, + &options::options_file_specified_ >; + } +}; + +static _cli_options_map_init _cli_options_map_init_; + +bool options:: +_parse (const char* o, ::cli::scanner& s) +{ + _cli_options_map::const_iterator i (_cli_options_map_.find (o)); + + if (i != _cli_options_map_.end ()) + { + (*(i->second)) (*this, s); + return true; + } + + return false; +} + +bool options:: +_parse (::cli::scanner& s, + ::cli::unknown_mode opt_mode, + ::cli::unknown_mode arg_mode) +{ + // Can't skip combined flags (--no-combined-flags). + // + assert (opt_mode != ::cli::unknown_mode::skip); + + bool r = false; + bool opt = true; + + while (s.more ()) + { + const char* o = s.peek (); + + if (std::strcmp (o, "--") == 0) + { + opt = false; + s.skip (); + r = true; + continue; + } + + if (opt) + { + if (_parse (o, s)) + { + r = true; + continue; + } + + if (std::strncmp (o, "-", 1) == 0 && o[1] != '\0') + { + // Handle combined option values. + // + std::string co; + if (const char* v = std::strchr (o, '=')) + { + co.assign (o, 0, v - o); + ++v; + + int ac (2); + char* av[] = + { + const_cast (co.c_str ()), + const_cast (v) + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (_parse (co.c_str (), ns)) + { + // Parsed the option but not its value? + // + if (ns.end () != 2) + throw ::cli::invalid_value (co, v); + + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = co.c_str (); + } + } + + // Handle combined flags. + // + char cf[3]; + { + const char* p = o + 1; + for (; *p != '\0'; ++p) + { + if (!((*p >= 'a' && *p <= 'z') || + (*p >= 'A' && *p <= 'Z') || + (*p >= '0' && *p <= '9'))) + break; + } + + if (*p == '\0') + { + for (p = o + 1; *p != '\0'; ++p) + { + std::strcpy (cf, "-"); + cf[1] = *p; + cf[2] = '\0'; + + int ac (1); + char* av[] = + { + cf + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (!_parse (cf, ns)) + break; + } + + if (*p == '\0') + { + // All handled. + // + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = cf; + } + } + } + + switch (opt_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_option (o); + } + } + + break; + } + } + + switch (arg_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_argument (o); + } + } + + break; + } + + return r; +} + +// Begin epilogue. +// +// +// End epilogue. + diff --git a/cli/cli/pregenerated/cli/options.hxx b/cli/cli/pregenerated/cli/options.hxx new file mode 100644 index 0000000..08180f3 --- /dev/null +++ b/cli/cli/pregenerated/cli/options.hxx @@ -0,0 +1,1700 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef CLI_OPTIONS_HXX +#define CLI_OPTIONS_HXX + +// Begin prologue. +// +// +// End prologue. + +#include +#include +#include +#include +#include +#include + +#ifndef CLI_POTENTIALLY_UNUSED +# if defined(_MSC_VER) || defined(__xlC__) +# define CLI_POTENTIALLY_UNUSED(x) (void*)&x +# else +# define CLI_POTENTIALLY_UNUSED(x) (void)x +# endif +#endif + +namespace cli +{ + class usage_para + { + public: + enum value + { + none, + text, + option + }; + + usage_para (value); + + operator value () const + { + return v_; + } + + private: + value v_; + }; + + class unknown_mode + { + public: + enum value + { + skip, + stop, + fail + }; + + unknown_mode (value); + + operator value () const + { + return v_; + } + + private: + value v_; + }; + + // Exceptions. + // + + class exception: public std::exception + { + public: + virtual void + print (::std::ostream&) const = 0; + }; + + ::std::ostream& + operator<< (::std::ostream&, const exception&); + + class unknown_option: public exception + { + public: + virtual + ~unknown_option () throw (); + + unknown_option (const std::string& option); + + const std::string& + option () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class unknown_argument: public exception + { + public: + virtual + ~unknown_argument () throw (); + + unknown_argument (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + class missing_value: public exception + { + public: + virtual + ~missing_value () throw (); + + missing_value (const std::string& option); + + const std::string& + option () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class invalid_value: public exception + { + public: + virtual + ~invalid_value () throw (); + + invalid_value (const std::string& option, + const std::string& value, + const std::string& message = std::string ()); + + const std::string& + option () const; + + const std::string& + value () const; + + const std::string& + message () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + std::string value_; + std::string message_; + }; + + class eos_reached: public exception + { + public: + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + }; + + class file_io_failure: public exception + { + public: + virtual + ~file_io_failure () throw (); + + file_io_failure (const std::string& file); + + const std::string& + file () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string file_; + }; + + class unmatched_quote: public exception + { + public: + virtual + ~unmatched_quote () throw (); + + unmatched_quote (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + // Command line argument scanner interface. + // + // The values returned by next() are guaranteed to be valid + // for the two previous arguments up until a call to a third + // peek() or next(). + // + // The position() function returns a monotonically-increasing + // number which, if stored, can later be used to determine the + // relative position of the argument returned by the following + // call to next(). Note that if multiple scanners are used to + // extract arguments from multiple sources, then the end + // position of the previous scanner should be used as the + // start position of the next. + // + class scanner + { + public: + virtual + ~scanner (); + + virtual bool + more () = 0; + + virtual const char* + peek () = 0; + + virtual const char* + next () = 0; + + virtual void + skip () = 0; + + virtual std::size_t + position () = 0; + }; + + class argv_scanner: public scanner + { + public: + argv_scanner (int& argc, + char** argv, + bool erase = false, + std::size_t start_position = 0); + + argv_scanner (int start, + int& argc, + char** argv, + bool erase = false, + std::size_t start_position = 0); + + int + end () const; + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + virtual std::size_t + position (); + + protected: + std::size_t start_position_; + int i_; + int& argc_; + char** argv_; + bool erase_; + }; + + class argv_file_scanner: public argv_scanner + { + public: + argv_file_scanner (int& argc, + char** argv, + const std::string& option, + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& option, + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (const std::string& file, + const std::string& option, + std::size_t start_position = 0); + + struct option_info + { + // If search_func is not NULL, it is called, with the arg + // value as the second argument, to locate the options file. + // If it returns an empty string, then the file is ignored. + // + const char* option; + std::string (*search_func) (const char*, void* arg); + void* arg; + }; + + argv_file_scanner (int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (int start, + int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (const std::string& file, + const option_info* options = 0, + std::size_t options_count = 0, + std::size_t start_position = 0); + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + virtual std::size_t + position (); + + // Return the file path if the peeked at argument came from a file and + // the empty string otherwise. The reference is guaranteed to be valid + // till the end of the scanner lifetime. + // + const std::string& + peek_file (); + + // Return the 1-based line number if the peeked at argument came from + // a file and zero otherwise. + // + std::size_t + peek_line (); + + private: + const option_info* + find (const char*) const; + + void + load (const std::string& file); + + typedef argv_scanner base; + + const std::string option_; + option_info option_info_; + const option_info* options_; + std::size_t options_count_; + + struct arg + { + std::string value; + const std::string* file; + std::size_t line; + }; + + std::deque args_; + std::list files_; + + // Circular buffer of two arguments. + // + std::string hold_[2]; + std::size_t i_; + + bool skip_; + + static int zero_argc_; + static std::string empty_string_; + }; + + template + struct parser; +} + +#include + +#include + +#include + +#include + +#include + +#include + +class options +{ + public: + options (); + + options (int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (::cli::scanner&, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + // Option accessors and modifiers. + // + const std::uint64_t& + build2_metadata () const; + + std::uint64_t& + build2_metadata (); + + void + build2_metadata (const std::uint64_t&); + + bool + build2_metadata_specified () const; + + void + build2_metadata_specified (bool); + + const bool& + help () const; + + bool& + help (); + + void + help (const bool&); + + const bool& + version () const; + + bool& + version (); + + void + version (const bool&); + + const std::vector& + include_path () const; + + std::vector& + include_path (); + + void + include_path (const std::vector&); + + bool + include_path_specified () const; + + void + include_path_specified (bool); + + const std::string& + output_dir () const; + + std::string& + output_dir (); + + void + output_dir (const std::string&); + + bool + output_dir_specified () const; + + void + output_dir_specified (bool); + + const cxx_version& + std () const; + + cxx_version& + std (); + + void + std (const cxx_version&); + + bool + std_specified () const; + + void + std_specified (bool); + + const bool& + generate_modifier () const; + + bool& + generate_modifier (); + + void + generate_modifier (const bool&); + + const bool& + generate_specifier () const; + + bool& + generate_specifier (); + + void + generate_specifier (const bool&); + + const bool& + generate_parse () const; + + bool& + generate_parse (); + + void + generate_parse (const bool&); + + const bool& + generate_merge () const; + + bool& + generate_merge (); + + void + generate_merge (const bool&); + + const bool& + generate_description () const; + + bool& + generate_description (); + + void + generate_description (const bool&); + + const bool& + generate_file_scanner () const; + + bool& + generate_file_scanner (); + + void + generate_file_scanner (const bool&); + + const bool& + generate_vector_scanner () const; + + bool& + generate_vector_scanner (); + + void + generate_vector_scanner (const bool&); + + const bool& + generate_group_scanner () const; + + bool& + generate_group_scanner (); + + void + generate_group_scanner (const bool&); + + const bool& + suppress_inline () const; + + bool& + suppress_inline (); + + void + suppress_inline (const bool&); + + const bool& + suppress_cli () const; + + bool& + suppress_cli (); + + void + suppress_cli (const bool&); + + const std::string& + cli_namespace () const; + + std::string& + cli_namespace (); + + void + cli_namespace (const std::string&); + + bool + cli_namespace_specified () const; + + void + cli_namespace_specified (bool); + + const std::string& + ostream_type () const; + + std::string& + ostream_type (); + + void + ostream_type (const std::string&); + + bool + ostream_type_specified () const; + + void + ostream_type_specified (bool); + + const std::string& + export_symbol () const; + + std::string& + export_symbol (); + + void + export_symbol (const std::string&); + + bool + export_symbol_specified () const; + + void + export_symbol_specified (bool); + + const bool& + generate_cxx () const; + + bool& + generate_cxx (); + + void + generate_cxx (const bool&); + + const bool& + generate_man () const; + + bool& + generate_man (); + + void + generate_man (const bool&); + + const bool& + generate_html () const; + + bool& + generate_html (); + + void + generate_html (const bool&); + + const bool& + generate_txt () const; + + bool& + generate_txt (); + + void + generate_txt (const bool&); + + const bool& + stdout_ () const; + + bool& + stdout_ (); + + void + stdout_ (const bool&); + + const bool& + suppress_undocumented () const; + + bool& + suppress_undocumented (); + + void + suppress_undocumented (const bool&); + + const bool& + suppress_usage () const; + + bool& + suppress_usage (); + + void + suppress_usage (const bool&); + + const bool& + long_usage () const; + + bool& + long_usage (); + + void + long_usage (const bool&); + + const bool& + short_usage () const; + + bool& + short_usage (); + + void + short_usage (const bool&); + + const std::string& + page_usage () const; + + std::string& + page_usage (); + + void + page_usage (const std::string&); + + bool + page_usage_specified () const; + + void + page_usage_specified (bool); + + const std::size_t& + option_length () const; + + std::size_t& + option_length (); + + void + option_length (const std::size_t&); + + bool + option_length_specified () const; + + void + option_length_specified (bool); + + const bool& + ascii_tree () const; + + bool& + ascii_tree (); + + void + ascii_tree (const bool&); + + const bool& + ansi_color () const; + + bool& + ansi_color (); + + void + ansi_color (const bool&); + + const bool& + exclude_base () const; + + bool& + exclude_base (); + + void + exclude_base (const bool&); + + const bool& + include_base_last () const; + + bool& + include_base_last (); + + void + include_base_last (const bool&); + + const std::map& + class_doc () const; + + std::map& + class_doc (); + + void + class_doc (const std::map&); + + bool + class_doc_specified () const; + + void + class_doc_specified (bool); + + const std::vector& + class_ () const; + + std::vector& + class_ (); + + void + class_ (const std::vector&); + + bool + class__specified () const; + + void + class__specified (bool); + + const std::map& + docvar () const; + + std::map& + docvar (); + + void + docvar (const std::map&); + + bool + docvar_specified () const; + + void + docvar_specified (bool); + + const std::vector& + link_regex () const; + + std::vector& + link_regex (); + + void + link_regex (const std::vector&); + + bool + link_regex_specified () const; + + void + link_regex_specified (bool); + + const bool& + link_regex_trace () const; + + bool& + link_regex_trace (); + + void + link_regex_trace (const bool&); + + const std::map& + html_heading_map () const; + + std::map& + html_heading_map (); + + void + html_heading_map (const std::map&); + + bool + html_heading_map_specified () const; + + void + html_heading_map_specified (bool); + + const bool& + omit_link_check () const; + + bool& + omit_link_check (); + + void + omit_link_check (const bool&); + + const std::vector& + hxx_prologue () const; + + std::vector& + hxx_prologue (); + + void + hxx_prologue (const std::vector&); + + bool + hxx_prologue_specified () const; + + void + hxx_prologue_specified (bool); + + const std::vector& + ixx_prologue () const; + + std::vector& + ixx_prologue (); + + void + ixx_prologue (const std::vector&); + + bool + ixx_prologue_specified () const; + + void + ixx_prologue_specified (bool); + + const std::vector& + cxx_prologue () const; + + std::vector& + cxx_prologue (); + + void + cxx_prologue (const std::vector&); + + bool + cxx_prologue_specified () const; + + void + cxx_prologue_specified (bool); + + const std::vector& + man_prologue () const; + + std::vector& + man_prologue (); + + void + man_prologue (const std::vector&); + + bool + man_prologue_specified () const; + + void + man_prologue_specified (bool); + + const std::vector& + html_prologue () const; + + std::vector& + html_prologue (); + + void + html_prologue (const std::vector&); + + bool + html_prologue_specified () const; + + void + html_prologue_specified (bool); + + const std::vector& + txt_prologue () const; + + std::vector& + txt_prologue (); + + void + txt_prologue (const std::vector&); + + bool + txt_prologue_specified () const; + + void + txt_prologue_specified (bool); + + const std::vector& + hxx_epilogue () const; + + std::vector& + hxx_epilogue (); + + void + hxx_epilogue (const std::vector&); + + bool + hxx_epilogue_specified () const; + + void + hxx_epilogue_specified (bool); + + const std::vector& + ixx_epilogue () const; + + std::vector& + ixx_epilogue (); + + void + ixx_epilogue (const std::vector&); + + bool + ixx_epilogue_specified () const; + + void + ixx_epilogue_specified (bool); + + const std::vector& + cxx_epilogue () const; + + std::vector& + cxx_epilogue (); + + void + cxx_epilogue (const std::vector&); + + bool + cxx_epilogue_specified () const; + + void + cxx_epilogue_specified (bool); + + const std::vector& + man_epilogue () const; + + std::vector& + man_epilogue (); + + void + man_epilogue (const std::vector&); + + bool + man_epilogue_specified () const; + + void + man_epilogue_specified (bool); + + const std::vector& + html_epilogue () const; + + std::vector& + html_epilogue (); + + void + html_epilogue (const std::vector&); + + bool + html_epilogue_specified () const; + + void + html_epilogue_specified (bool); + + const std::vector& + txt_epilogue () const; + + std::vector& + txt_epilogue (); + + void + txt_epilogue (const std::vector&); + + bool + txt_epilogue_specified () const; + + void + txt_epilogue_specified (bool); + + const std::string& + hxx_prologue_file () const; + + std::string& + hxx_prologue_file (); + + void + hxx_prologue_file (const std::string&); + + bool + hxx_prologue_file_specified () const; + + void + hxx_prologue_file_specified (bool); + + const std::string& + ixx_prologue_file () const; + + std::string& + ixx_prologue_file (); + + void + ixx_prologue_file (const std::string&); + + bool + ixx_prologue_file_specified () const; + + void + ixx_prologue_file_specified (bool); + + const std::string& + cxx_prologue_file () const; + + std::string& + cxx_prologue_file (); + + void + cxx_prologue_file (const std::string&); + + bool + cxx_prologue_file_specified () const; + + void + cxx_prologue_file_specified (bool); + + const std::string& + man_prologue_file () const; + + std::string& + man_prologue_file (); + + void + man_prologue_file (const std::string&); + + bool + man_prologue_file_specified () const; + + void + man_prologue_file_specified (bool); + + const std::string& + html_prologue_file () const; + + std::string& + html_prologue_file (); + + void + html_prologue_file (const std::string&); + + bool + html_prologue_file_specified () const; + + void + html_prologue_file_specified (bool); + + const std::string& + txt_prologue_file () const; + + std::string& + txt_prologue_file (); + + void + txt_prologue_file (const std::string&); + + bool + txt_prologue_file_specified () const; + + void + txt_prologue_file_specified (bool); + + const std::string& + hxx_epilogue_file () const; + + std::string& + hxx_epilogue_file (); + + void + hxx_epilogue_file (const std::string&); + + bool + hxx_epilogue_file_specified () const; + + void + hxx_epilogue_file_specified (bool); + + const std::string& + ixx_epilogue_file () const; + + std::string& + ixx_epilogue_file (); + + void + ixx_epilogue_file (const std::string&); + + bool + ixx_epilogue_file_specified () const; + + void + ixx_epilogue_file_specified (bool); + + const std::string& + cxx_epilogue_file () const; + + std::string& + cxx_epilogue_file (); + + void + cxx_epilogue_file (const std::string&); + + bool + cxx_epilogue_file_specified () const; + + void + cxx_epilogue_file_specified (bool); + + const std::string& + man_epilogue_file () const; + + std::string& + man_epilogue_file (); + + void + man_epilogue_file (const std::string&); + + bool + man_epilogue_file_specified () const; + + void + man_epilogue_file_specified (bool); + + const std::string& + html_epilogue_file () const; + + std::string& + html_epilogue_file (); + + void + html_epilogue_file (const std::string&); + + bool + html_epilogue_file_specified () const; + + void + html_epilogue_file_specified (bool); + + const std::string& + txt_epilogue_file () const; + + std::string& + txt_epilogue_file (); + + void + txt_epilogue_file (const std::string&); + + bool + txt_epilogue_file_specified () const; + + void + txt_epilogue_file_specified (bool); + + const std::string& + output_prefix () const; + + std::string& + output_prefix (); + + void + output_prefix (const std::string&); + + bool + output_prefix_specified () const; + + void + output_prefix_specified (bool); + + const std::string& + output_suffix () const; + + std::string& + output_suffix (); + + void + output_suffix (const std::string&); + + bool + output_suffix_specified () const; + + void + output_suffix_specified (bool); + + const std::string& + hxx_suffix () const; + + std::string& + hxx_suffix (); + + void + hxx_suffix (const std::string&); + + bool + hxx_suffix_specified () const; + + void + hxx_suffix_specified (bool); + + const std::string& + ixx_suffix () const; + + std::string& + ixx_suffix (); + + void + ixx_suffix (const std::string&); + + bool + ixx_suffix_specified () const; + + void + ixx_suffix_specified (bool); + + const std::string& + cxx_suffix () const; + + std::string& + cxx_suffix (); + + void + cxx_suffix (const std::string&); + + bool + cxx_suffix_specified () const; + + void + cxx_suffix_specified (bool); + + const std::string& + man_suffix () const; + + std::string& + man_suffix (); + + void + man_suffix (const std::string&); + + bool + man_suffix_specified () const; + + void + man_suffix_specified (bool); + + const std::string& + html_suffix () const; + + std::string& + html_suffix (); + + void + html_suffix (const std::string&); + + bool + html_suffix_specified () const; + + void + html_suffix_specified (bool); + + const std::string& + txt_suffix () const; + + std::string& + txt_suffix (); + + void + txt_suffix (const std::string&); + + bool + txt_suffix_specified () const; + + void + txt_suffix_specified (bool); + + const std::string& + option_prefix () const; + + std::string& + option_prefix (); + + void + option_prefix (const std::string&); + + bool + option_prefix_specified () const; + + void + option_prefix_specified (bool); + + const std::string& + option_separator () const; + + std::string& + option_separator (); + + void + option_separator (const std::string&); + + bool + option_separator_specified () const; + + void + option_separator_specified (bool); + + const bool& + keep_separator () const; + + bool& + keep_separator (); + + void + keep_separator (const bool&); + + const bool& + no_combined_flags () const; + + bool& + no_combined_flags (); + + void + no_combined_flags (const bool&); + + const bool& + no_combined_values () const; + + bool& + no_combined_values (); + + void + no_combined_values (const bool&); + + const bool& + include_with_brackets () const; + + bool& + include_with_brackets (); + + void + include_with_brackets (const bool&); + + const std::string& + include_prefix () const; + + std::string& + include_prefix (); + + void + include_prefix (const std::string&); + + bool + include_prefix_specified () const; + + void + include_prefix_specified (bool); + + const std::string& + guard_prefix () const; + + std::string& + guard_prefix (); + + void + guard_prefix (const std::string&); + + bool + guard_prefix_specified () const; + + void + guard_prefix_specified (bool); + + const std::map& + reserved_name () const; + + std::map& + reserved_name (); + + void + reserved_name (const std::map&); + + bool + reserved_name_specified () const; + + void + reserved_name_specified (bool); + + const std::string& + options_file () const; + + std::string& + options_file (); + + void + options_file (const std::string&); + + bool + options_file_specified () const; + + void + options_file_specified (bool); + + // Print usage information. + // + static ::cli::usage_para + print_usage (::std::ostream&, + ::cli::usage_para = ::cli::usage_para::none); + + // Implementation details. + // + protected: + bool + _parse (const char*, ::cli::scanner&); + + private: + bool + _parse (::cli::scanner&, + ::cli::unknown_mode option, + ::cli::unknown_mode argument); + + public: + std::uint64_t build2_metadata_; + bool build2_metadata_specified_; + bool help_; + bool version_; + std::vector include_path_; + bool include_path_specified_; + std::string output_dir_; + bool output_dir_specified_; + cxx_version std_; + bool std_specified_; + bool generate_modifier_; + bool generate_specifier_; + bool generate_parse_; + bool generate_merge_; + bool generate_description_; + bool generate_file_scanner_; + bool generate_vector_scanner_; + bool generate_group_scanner_; + bool suppress_inline_; + bool suppress_cli_; + std::string cli_namespace_; + bool cli_namespace_specified_; + std::string ostream_type_; + bool ostream_type_specified_; + std::string export_symbol_; + bool export_symbol_specified_; + bool generate_cxx_; + bool generate_man_; + bool generate_html_; + bool generate_txt_; + bool stdout__; + bool suppress_undocumented_; + bool suppress_usage_; + bool long_usage_; + bool short_usage_; + std::string page_usage_; + bool page_usage_specified_; + std::size_t option_length_; + bool option_length_specified_; + bool ascii_tree_; + bool ansi_color_; + bool exclude_base_; + bool include_base_last_; + std::map class_doc_; + bool class_doc_specified_; + std::vector class__; + bool class__specified_; + std::map docvar_; + bool docvar_specified_; + std::vector link_regex_; + bool link_regex_specified_; + bool link_regex_trace_; + std::map html_heading_map_; + bool html_heading_map_specified_; + bool omit_link_check_; + std::vector hxx_prologue_; + bool hxx_prologue_specified_; + std::vector ixx_prologue_; + bool ixx_prologue_specified_; + std::vector cxx_prologue_; + bool cxx_prologue_specified_; + std::vector man_prologue_; + bool man_prologue_specified_; + std::vector html_prologue_; + bool html_prologue_specified_; + std::vector txt_prologue_; + bool txt_prologue_specified_; + std::vector hxx_epilogue_; + bool hxx_epilogue_specified_; + std::vector ixx_epilogue_; + bool ixx_epilogue_specified_; + std::vector cxx_epilogue_; + bool cxx_epilogue_specified_; + std::vector man_epilogue_; + bool man_epilogue_specified_; + std::vector html_epilogue_; + bool html_epilogue_specified_; + std::vector txt_epilogue_; + bool txt_epilogue_specified_; + std::string hxx_prologue_file_; + bool hxx_prologue_file_specified_; + std::string ixx_prologue_file_; + bool ixx_prologue_file_specified_; + std::string cxx_prologue_file_; + bool cxx_prologue_file_specified_; + std::string man_prologue_file_; + bool man_prologue_file_specified_; + std::string html_prologue_file_; + bool html_prologue_file_specified_; + std::string txt_prologue_file_; + bool txt_prologue_file_specified_; + std::string hxx_epilogue_file_; + bool hxx_epilogue_file_specified_; + std::string ixx_epilogue_file_; + bool ixx_epilogue_file_specified_; + std::string cxx_epilogue_file_; + bool cxx_epilogue_file_specified_; + std::string man_epilogue_file_; + bool man_epilogue_file_specified_; + std::string html_epilogue_file_; + bool html_epilogue_file_specified_; + std::string txt_epilogue_file_; + bool txt_epilogue_file_specified_; + std::string output_prefix_; + bool output_prefix_specified_; + std::string output_suffix_; + bool output_suffix_specified_; + std::string hxx_suffix_; + bool hxx_suffix_specified_; + std::string ixx_suffix_; + bool ixx_suffix_specified_; + std::string cxx_suffix_; + bool cxx_suffix_specified_; + std::string man_suffix_; + bool man_suffix_specified_; + std::string html_suffix_; + bool html_suffix_specified_; + std::string txt_suffix_; + bool txt_suffix_specified_; + std::string option_prefix_; + bool option_prefix_specified_; + std::string option_separator_; + bool option_separator_specified_; + bool keep_separator_; + bool no_combined_flags_; + bool no_combined_values_; + bool include_with_brackets_; + std::string include_prefix_; + bool include_prefix_specified_; + std::string guard_prefix_; + bool guard_prefix_specified_; + std::map reserved_name_; + bool reserved_name_specified_; + std::string options_file_; + bool options_file_specified_; +}; + +#include + +// Begin epilogue. +// +// +// End epilogue. + +#endif // CLI_OPTIONS_HXX diff --git a/cli/cli/pregenerated/cli/options.ixx b/cli/cli/pregenerated/cli/options.ixx new file mode 100644 index 0000000..e3fd397 --- /dev/null +++ b/cli/cli/pregenerated/cli/options.ixx @@ -0,0 +1,2400 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +// +// End prologue. + +#include + +namespace cli +{ + // usage_para + // + inline usage_para:: + usage_para (value v) + : v_ (v) + { + } + + // unknown_mode + // + inline unknown_mode:: + unknown_mode (value v) + : v_ (v) + { + } + + // exception + // + inline ::std::ostream& + operator<< (::std::ostream& os, const exception& e) + { + e.print (os); + return os; + } + + // unknown_option + // + inline unknown_option:: + unknown_option (const std::string& option) + : option_ (option) + { + } + + inline const std::string& unknown_option:: + option () const + { + return option_; + } + + // unknown_argument + // + inline unknown_argument:: + unknown_argument (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unknown_argument:: + argument () const + { + return argument_; + } + + // missing_value + // + inline missing_value:: + missing_value (const std::string& option) + : option_ (option) + { + } + + inline const std::string& missing_value:: + option () const + { + return option_; + } + + // invalid_value + // + inline invalid_value:: + invalid_value (const std::string& option, + const std::string& value, + const std::string& message) + : option_ (option), + value_ (value), + message_ (message) + { + } + + inline const std::string& invalid_value:: + option () const + { + return option_; + } + + inline const std::string& invalid_value:: + value () const + { + return value_; + } + + inline const std::string& invalid_value:: + message () const + { + return message_; + } + + // file_io_failure + // + inline file_io_failure:: + file_io_failure (const std::string& file) + : file_ (file) + { + } + + inline const std::string& file_io_failure:: + file () const + { + return file_; + } + + // unmatched_quote + // + inline unmatched_quote:: + unmatched_quote (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unmatched_quote:: + argument () const + { + return argument_; + } + + // argv_scanner + // + inline argv_scanner:: + argv_scanner (int& argc, + char** argv, + bool erase, + std::size_t sp) + : start_position_ (sp + 1), + i_ (1), + argc_ (argc), + argv_ (argv), + erase_ (erase) + { + } + + inline argv_scanner:: + argv_scanner (int start, + int& argc, + char** argv, + bool erase, + std::size_t sp) + : start_position_ (sp + static_cast (start)), + i_ (start), + argc_ (argc), + argv_ (argv), + erase_ (erase) + { + } + + inline int argv_scanner:: + end () const + { + return i_; + } + + // argv_file_scanner + // + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const std::string& option, + bool erase, + std::size_t sp) + : argv_scanner (argc, argv, erase, sp), + option_ (option), + options_ (&option_info_), + options_count_ (1), + i_ (1), + skip_ (false) + { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& option, + bool erase, + std::size_t sp) + : argv_scanner (start, argc, argv, erase, sp), + option_ (option), + options_ (&option_info_), + options_count_ (1), + i_ (1), + skip_ (false) + { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; + } + + inline argv_file_scanner:: + argv_file_scanner (const std::string& file, + const std::string& option, + std::size_t sp) + : argv_scanner (0, zero_argc_, 0, sp), + option_ (option), + options_ (&option_info_), + options_count_ (1), + i_ (1), + skip_ (false) + { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; + + load (file); + } + + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase, + std::size_t sp) + : argv_scanner (argc, argv, erase, sp), + options_ (options), + options_count_ (options_count), + i_ (1), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase, + std::size_t sp) + : argv_scanner (start, argc, argv, erase, sp), + options_ (options), + options_count_ (options_count), + i_ (1), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (const std::string& file, + const option_info* options, + std::size_t options_count, + std::size_t sp) + : argv_scanner (0, zero_argc_, 0, sp), + options_ (options), + options_count_ (options_count), + i_ (1), + skip_ (false) + { + load (file); + } +} + +// options +// + +inline const std::uint64_t& options:: +build2_metadata () const +{ + return this->build2_metadata_; +} + +inline std::uint64_t& options:: +build2_metadata () +{ + return this->build2_metadata_; +} + +inline void options:: +build2_metadata (const std::uint64_t& x) +{ + this->build2_metadata_ = x; +} + +inline bool options:: +build2_metadata_specified () const +{ + return this->build2_metadata_specified_; +} + +inline void options:: +build2_metadata_specified (bool x) +{ + this->build2_metadata_specified_ = x; +} + +inline const bool& options:: +help () const +{ + return this->help_; +} + +inline bool& options:: +help () +{ + return this->help_; +} + +inline void options:: +help (const bool& x) +{ + this->help_ = x; +} + +inline const bool& options:: +version () const +{ + return this->version_; +} + +inline bool& options:: +version () +{ + return this->version_; +} + +inline void options:: +version (const bool& x) +{ + this->version_ = x; +} + +inline const std::vector& options:: +include_path () const +{ + return this->include_path_; +} + +inline std::vector& options:: +include_path () +{ + return this->include_path_; +} + +inline void options:: +include_path (const std::vector& x) +{ + this->include_path_ = x; +} + +inline bool options:: +include_path_specified () const +{ + return this->include_path_specified_; +} + +inline void options:: +include_path_specified (bool x) +{ + this->include_path_specified_ = x; +} + +inline const std::string& options:: +output_dir () const +{ + return this->output_dir_; +} + +inline std::string& options:: +output_dir () +{ + return this->output_dir_; +} + +inline void options:: +output_dir (const std::string& x) +{ + this->output_dir_ = x; +} + +inline bool options:: +output_dir_specified () const +{ + return this->output_dir_specified_; +} + +inline void options:: +output_dir_specified (bool x) +{ + this->output_dir_specified_ = x; +} + +inline const cxx_version& options:: +std () const +{ + return this->std_; +} + +inline cxx_version& options:: +std () +{ + return this->std_; +} + +inline void options:: +std (const cxx_version& x) +{ + this->std_ = x; +} + +inline bool options:: +std_specified () const +{ + return this->std_specified_; +} + +inline void options:: +std_specified (bool x) +{ + this->std_specified_ = x; +} + +inline const bool& options:: +generate_modifier () const +{ + return this->generate_modifier_; +} + +inline bool& options:: +generate_modifier () +{ + return this->generate_modifier_; +} + +inline void options:: +generate_modifier (const bool& x) +{ + this->generate_modifier_ = x; +} + +inline const bool& options:: +generate_specifier () const +{ + return this->generate_specifier_; +} + +inline bool& options:: +generate_specifier () +{ + return this->generate_specifier_; +} + +inline void options:: +generate_specifier (const bool& x) +{ + this->generate_specifier_ = x; +} + +inline const bool& options:: +generate_parse () const +{ + return this->generate_parse_; +} + +inline bool& options:: +generate_parse () +{ + return this->generate_parse_; +} + +inline void options:: +generate_parse (const bool& x) +{ + this->generate_parse_ = x; +} + +inline const bool& options:: +generate_merge () const +{ + return this->generate_merge_; +} + +inline bool& options:: +generate_merge () +{ + return this->generate_merge_; +} + +inline void options:: +generate_merge (const bool& x) +{ + this->generate_merge_ = x; +} + +inline const bool& options:: +generate_description () const +{ + return this->generate_description_; +} + +inline bool& options:: +generate_description () +{ + return this->generate_description_; +} + +inline void options:: +generate_description (const bool& x) +{ + this->generate_description_ = x; +} + +inline const bool& options:: +generate_file_scanner () const +{ + return this->generate_file_scanner_; +} + +inline bool& options:: +generate_file_scanner () +{ + return this->generate_file_scanner_; +} + +inline void options:: +generate_file_scanner (const bool& x) +{ + this->generate_file_scanner_ = x; +} + +inline const bool& options:: +generate_vector_scanner () const +{ + return this->generate_vector_scanner_; +} + +inline bool& options:: +generate_vector_scanner () +{ + return this->generate_vector_scanner_; +} + +inline void options:: +generate_vector_scanner (const bool& x) +{ + this->generate_vector_scanner_ = x; +} + +inline const bool& options:: +generate_group_scanner () const +{ + return this->generate_group_scanner_; +} + +inline bool& options:: +generate_group_scanner () +{ + return this->generate_group_scanner_; +} + +inline void options:: +generate_group_scanner (const bool& x) +{ + this->generate_group_scanner_ = x; +} + +inline const bool& options:: +suppress_inline () const +{ + return this->suppress_inline_; +} + +inline bool& options:: +suppress_inline () +{ + return this->suppress_inline_; +} + +inline void options:: +suppress_inline (const bool& x) +{ + this->suppress_inline_ = x; +} + +inline const bool& options:: +suppress_cli () const +{ + return this->suppress_cli_; +} + +inline bool& options:: +suppress_cli () +{ + return this->suppress_cli_; +} + +inline void options:: +suppress_cli (const bool& x) +{ + this->suppress_cli_ = x; +} + +inline const std::string& options:: +cli_namespace () const +{ + return this->cli_namespace_; +} + +inline std::string& options:: +cli_namespace () +{ + return this->cli_namespace_; +} + +inline void options:: +cli_namespace (const std::string& x) +{ + this->cli_namespace_ = x; +} + +inline bool options:: +cli_namespace_specified () const +{ + return this->cli_namespace_specified_; +} + +inline void options:: +cli_namespace_specified (bool x) +{ + this->cli_namespace_specified_ = x; +} + +inline const std::string& options:: +ostream_type () const +{ + return this->ostream_type_; +} + +inline std::string& options:: +ostream_type () +{ + return this->ostream_type_; +} + +inline void options:: +ostream_type (const std::string& x) +{ + this->ostream_type_ = x; +} + +inline bool options:: +ostream_type_specified () const +{ + return this->ostream_type_specified_; +} + +inline void options:: +ostream_type_specified (bool x) +{ + this->ostream_type_specified_ = x; +} + +inline const std::string& options:: +export_symbol () const +{ + return this->export_symbol_; +} + +inline std::string& options:: +export_symbol () +{ + return this->export_symbol_; +} + +inline void options:: +export_symbol (const std::string& x) +{ + this->export_symbol_ = x; +} + +inline bool options:: +export_symbol_specified () const +{ + return this->export_symbol_specified_; +} + +inline void options:: +export_symbol_specified (bool x) +{ + this->export_symbol_specified_ = x; +} + +inline const bool& options:: +generate_cxx () const +{ + return this->generate_cxx_; +} + +inline bool& options:: +generate_cxx () +{ + return this->generate_cxx_; +} + +inline void options:: +generate_cxx (const bool& x) +{ + this->generate_cxx_ = x; +} + +inline const bool& options:: +generate_man () const +{ + return this->generate_man_; +} + +inline bool& options:: +generate_man () +{ + return this->generate_man_; +} + +inline void options:: +generate_man (const bool& x) +{ + this->generate_man_ = x; +} + +inline const bool& options:: +generate_html () const +{ + return this->generate_html_; +} + +inline bool& options:: +generate_html () +{ + return this->generate_html_; +} + +inline void options:: +generate_html (const bool& x) +{ + this->generate_html_ = x; +} + +inline const bool& options:: +generate_txt () const +{ + return this->generate_txt_; +} + +inline bool& options:: +generate_txt () +{ + return this->generate_txt_; +} + +inline void options:: +generate_txt (const bool& x) +{ + this->generate_txt_ = x; +} + +inline const bool& options:: +stdout_ () const +{ + return this->stdout__; +} + +inline bool& options:: +stdout_ () +{ + return this->stdout__; +} + +inline void options:: +stdout_ (const bool& x) +{ + this->stdout__ = x; +} + +inline const bool& options:: +suppress_undocumented () const +{ + return this->suppress_undocumented_; +} + +inline bool& options:: +suppress_undocumented () +{ + return this->suppress_undocumented_; +} + +inline void options:: +suppress_undocumented (const bool& x) +{ + this->suppress_undocumented_ = x; +} + +inline const bool& options:: +suppress_usage () const +{ + return this->suppress_usage_; +} + +inline bool& options:: +suppress_usage () +{ + return this->suppress_usage_; +} + +inline void options:: +suppress_usage (const bool& x) +{ + this->suppress_usage_ = x; +} + +inline const bool& options:: +long_usage () const +{ + return this->long_usage_; +} + +inline bool& options:: +long_usage () +{ + return this->long_usage_; +} + +inline void options:: +long_usage (const bool& x) +{ + this->long_usage_ = x; +} + +inline const bool& options:: +short_usage () const +{ + return this->short_usage_; +} + +inline bool& options:: +short_usage () +{ + return this->short_usage_; +} + +inline void options:: +short_usage (const bool& x) +{ + this->short_usage_ = x; +} + +inline const std::string& options:: +page_usage () const +{ + return this->page_usage_; +} + +inline std::string& options:: +page_usage () +{ + return this->page_usage_; +} + +inline void options:: +page_usage (const std::string& x) +{ + this->page_usage_ = x; +} + +inline bool options:: +page_usage_specified () const +{ + return this->page_usage_specified_; +} + +inline void options:: +page_usage_specified (bool x) +{ + this->page_usage_specified_ = x; +} + +inline const std::size_t& options:: +option_length () const +{ + return this->option_length_; +} + +inline std::size_t& options:: +option_length () +{ + return this->option_length_; +} + +inline void options:: +option_length (const std::size_t& x) +{ + this->option_length_ = x; +} + +inline bool options:: +option_length_specified () const +{ + return this->option_length_specified_; +} + +inline void options:: +option_length_specified (bool x) +{ + this->option_length_specified_ = x; +} + +inline const bool& options:: +ascii_tree () const +{ + return this->ascii_tree_; +} + +inline bool& options:: +ascii_tree () +{ + return this->ascii_tree_; +} + +inline void options:: +ascii_tree (const bool& x) +{ + this->ascii_tree_ = x; +} + +inline const bool& options:: +ansi_color () const +{ + return this->ansi_color_; +} + +inline bool& options:: +ansi_color () +{ + return this->ansi_color_; +} + +inline void options:: +ansi_color (const bool& x) +{ + this->ansi_color_ = x; +} + +inline const bool& options:: +exclude_base () const +{ + return this->exclude_base_; +} + +inline bool& options:: +exclude_base () +{ + return this->exclude_base_; +} + +inline void options:: +exclude_base (const bool& x) +{ + this->exclude_base_ = x; +} + +inline const bool& options:: +include_base_last () const +{ + return this->include_base_last_; +} + +inline bool& options:: +include_base_last () +{ + return this->include_base_last_; +} + +inline void options:: +include_base_last (const bool& x) +{ + this->include_base_last_ = x; +} + +inline const std::map& options:: +class_doc () const +{ + return this->class_doc_; +} + +inline std::map& options:: +class_doc () +{ + return this->class_doc_; +} + +inline void options:: +class_doc (const std::map& x) +{ + this->class_doc_ = x; +} + +inline bool options:: +class_doc_specified () const +{ + return this->class_doc_specified_; +} + +inline void options:: +class_doc_specified (bool x) +{ + this->class_doc_specified_ = x; +} + +inline const std::vector& options:: +class_ () const +{ + return this->class__; +} + +inline std::vector& options:: +class_ () +{ + return this->class__; +} + +inline void options:: +class_ (const std::vector& x) +{ + this->class__ = x; +} + +inline bool options:: +class__specified () const +{ + return this->class__specified_; +} + +inline void options:: +class__specified (bool x) +{ + this->class__specified_ = x; +} + +inline const std::map& options:: +docvar () const +{ + return this->docvar_; +} + +inline std::map& options:: +docvar () +{ + return this->docvar_; +} + +inline void options:: +docvar (const std::map& x) +{ + this->docvar_ = x; +} + +inline bool options:: +docvar_specified () const +{ + return this->docvar_specified_; +} + +inline void options:: +docvar_specified (bool x) +{ + this->docvar_specified_ = x; +} + +inline const std::vector& options:: +link_regex () const +{ + return this->link_regex_; +} + +inline std::vector& options:: +link_regex () +{ + return this->link_regex_; +} + +inline void options:: +link_regex (const std::vector& x) +{ + this->link_regex_ = x; +} + +inline bool options:: +link_regex_specified () const +{ + return this->link_regex_specified_; +} + +inline void options:: +link_regex_specified (bool x) +{ + this->link_regex_specified_ = x; +} + +inline const bool& options:: +link_regex_trace () const +{ + return this->link_regex_trace_; +} + +inline bool& options:: +link_regex_trace () +{ + return this->link_regex_trace_; +} + +inline void options:: +link_regex_trace (const bool& x) +{ + this->link_regex_trace_ = x; +} + +inline const std::map& options:: +html_heading_map () const +{ + return this->html_heading_map_; +} + +inline std::map& options:: +html_heading_map () +{ + return this->html_heading_map_; +} + +inline void options:: +html_heading_map (const std::map& x) +{ + this->html_heading_map_ = x; +} + +inline bool options:: +html_heading_map_specified () const +{ + return this->html_heading_map_specified_; +} + +inline void options:: +html_heading_map_specified (bool x) +{ + this->html_heading_map_specified_ = x; +} + +inline const bool& options:: +omit_link_check () const +{ + return this->omit_link_check_; +} + +inline bool& options:: +omit_link_check () +{ + return this->omit_link_check_; +} + +inline void options:: +omit_link_check (const bool& x) +{ + this->omit_link_check_ = x; +} + +inline const std::vector& options:: +hxx_prologue () const +{ + return this->hxx_prologue_; +} + +inline std::vector& options:: +hxx_prologue () +{ + return this->hxx_prologue_; +} + +inline void options:: +hxx_prologue (const std::vector& x) +{ + this->hxx_prologue_ = x; +} + +inline bool options:: +hxx_prologue_specified () const +{ + return this->hxx_prologue_specified_; +} + +inline void options:: +hxx_prologue_specified (bool x) +{ + this->hxx_prologue_specified_ = x; +} + +inline const std::vector& options:: +ixx_prologue () const +{ + return this->ixx_prologue_; +} + +inline std::vector& options:: +ixx_prologue () +{ + return this->ixx_prologue_; +} + +inline void options:: +ixx_prologue (const std::vector& x) +{ + this->ixx_prologue_ = x; +} + +inline bool options:: +ixx_prologue_specified () const +{ + return this->ixx_prologue_specified_; +} + +inline void options:: +ixx_prologue_specified (bool x) +{ + this->ixx_prologue_specified_ = x; +} + +inline const std::vector& options:: +cxx_prologue () const +{ + return this->cxx_prologue_; +} + +inline std::vector& options:: +cxx_prologue () +{ + return this->cxx_prologue_; +} + +inline void options:: +cxx_prologue (const std::vector& x) +{ + this->cxx_prologue_ = x; +} + +inline bool options:: +cxx_prologue_specified () const +{ + return this->cxx_prologue_specified_; +} + +inline void options:: +cxx_prologue_specified (bool x) +{ + this->cxx_prologue_specified_ = x; +} + +inline const std::vector& options:: +man_prologue () const +{ + return this->man_prologue_; +} + +inline std::vector& options:: +man_prologue () +{ + return this->man_prologue_; +} + +inline void options:: +man_prologue (const std::vector& x) +{ + this->man_prologue_ = x; +} + +inline bool options:: +man_prologue_specified () const +{ + return this->man_prologue_specified_; +} + +inline void options:: +man_prologue_specified (bool x) +{ + this->man_prologue_specified_ = x; +} + +inline const std::vector& options:: +html_prologue () const +{ + return this->html_prologue_; +} + +inline std::vector& options:: +html_prologue () +{ + return this->html_prologue_; +} + +inline void options:: +html_prologue (const std::vector& x) +{ + this->html_prologue_ = x; +} + +inline bool options:: +html_prologue_specified () const +{ + return this->html_prologue_specified_; +} + +inline void options:: +html_prologue_specified (bool x) +{ + this->html_prologue_specified_ = x; +} + +inline const std::vector& options:: +txt_prologue () const +{ + return this->txt_prologue_; +} + +inline std::vector& options:: +txt_prologue () +{ + return this->txt_prologue_; +} + +inline void options:: +txt_prologue (const std::vector& x) +{ + this->txt_prologue_ = x; +} + +inline bool options:: +txt_prologue_specified () const +{ + return this->txt_prologue_specified_; +} + +inline void options:: +txt_prologue_specified (bool x) +{ + this->txt_prologue_specified_ = x; +} + +inline const std::vector& options:: +hxx_epilogue () const +{ + return this->hxx_epilogue_; +} + +inline std::vector& options:: +hxx_epilogue () +{ + return this->hxx_epilogue_; +} + +inline void options:: +hxx_epilogue (const std::vector& x) +{ + this->hxx_epilogue_ = x; +} + +inline bool options:: +hxx_epilogue_specified () const +{ + return this->hxx_epilogue_specified_; +} + +inline void options:: +hxx_epilogue_specified (bool x) +{ + this->hxx_epilogue_specified_ = x; +} + +inline const std::vector& options:: +ixx_epilogue () const +{ + return this->ixx_epilogue_; +} + +inline std::vector& options:: +ixx_epilogue () +{ + return this->ixx_epilogue_; +} + +inline void options:: +ixx_epilogue (const std::vector& x) +{ + this->ixx_epilogue_ = x; +} + +inline bool options:: +ixx_epilogue_specified () const +{ + return this->ixx_epilogue_specified_; +} + +inline void options:: +ixx_epilogue_specified (bool x) +{ + this->ixx_epilogue_specified_ = x; +} + +inline const std::vector& options:: +cxx_epilogue () const +{ + return this->cxx_epilogue_; +} + +inline std::vector& options:: +cxx_epilogue () +{ + return this->cxx_epilogue_; +} + +inline void options:: +cxx_epilogue (const std::vector& x) +{ + this->cxx_epilogue_ = x; +} + +inline bool options:: +cxx_epilogue_specified () const +{ + return this->cxx_epilogue_specified_; +} + +inline void options:: +cxx_epilogue_specified (bool x) +{ + this->cxx_epilogue_specified_ = x; +} + +inline const std::vector& options:: +man_epilogue () const +{ + return this->man_epilogue_; +} + +inline std::vector& options:: +man_epilogue () +{ + return this->man_epilogue_; +} + +inline void options:: +man_epilogue (const std::vector& x) +{ + this->man_epilogue_ = x; +} + +inline bool options:: +man_epilogue_specified () const +{ + return this->man_epilogue_specified_; +} + +inline void options:: +man_epilogue_specified (bool x) +{ + this->man_epilogue_specified_ = x; +} + +inline const std::vector& options:: +html_epilogue () const +{ + return this->html_epilogue_; +} + +inline std::vector& options:: +html_epilogue () +{ + return this->html_epilogue_; +} + +inline void options:: +html_epilogue (const std::vector& x) +{ + this->html_epilogue_ = x; +} + +inline bool options:: +html_epilogue_specified () const +{ + return this->html_epilogue_specified_; +} + +inline void options:: +html_epilogue_specified (bool x) +{ + this->html_epilogue_specified_ = x; +} + +inline const std::vector& options:: +txt_epilogue () const +{ + return this->txt_epilogue_; +} + +inline std::vector& options:: +txt_epilogue () +{ + return this->txt_epilogue_; +} + +inline void options:: +txt_epilogue (const std::vector& x) +{ + this->txt_epilogue_ = x; +} + +inline bool options:: +txt_epilogue_specified () const +{ + return this->txt_epilogue_specified_; +} + +inline void options:: +txt_epilogue_specified (bool x) +{ + this->txt_epilogue_specified_ = x; +} + +inline const std::string& options:: +hxx_prologue_file () const +{ + return this->hxx_prologue_file_; +} + +inline std::string& options:: +hxx_prologue_file () +{ + return this->hxx_prologue_file_; +} + +inline void options:: +hxx_prologue_file (const std::string& x) +{ + this->hxx_prologue_file_ = x; +} + +inline bool options:: +hxx_prologue_file_specified () const +{ + return this->hxx_prologue_file_specified_; +} + +inline void options:: +hxx_prologue_file_specified (bool x) +{ + this->hxx_prologue_file_specified_ = x; +} + +inline const std::string& options:: +ixx_prologue_file () const +{ + return this->ixx_prologue_file_; +} + +inline std::string& options:: +ixx_prologue_file () +{ + return this->ixx_prologue_file_; +} + +inline void options:: +ixx_prologue_file (const std::string& x) +{ + this->ixx_prologue_file_ = x; +} + +inline bool options:: +ixx_prologue_file_specified () const +{ + return this->ixx_prologue_file_specified_; +} + +inline void options:: +ixx_prologue_file_specified (bool x) +{ + this->ixx_prologue_file_specified_ = x; +} + +inline const std::string& options:: +cxx_prologue_file () const +{ + return this->cxx_prologue_file_; +} + +inline std::string& options:: +cxx_prologue_file () +{ + return this->cxx_prologue_file_; +} + +inline void options:: +cxx_prologue_file (const std::string& x) +{ + this->cxx_prologue_file_ = x; +} + +inline bool options:: +cxx_prologue_file_specified () const +{ + return this->cxx_prologue_file_specified_; +} + +inline void options:: +cxx_prologue_file_specified (bool x) +{ + this->cxx_prologue_file_specified_ = x; +} + +inline const std::string& options:: +man_prologue_file () const +{ + return this->man_prologue_file_; +} + +inline std::string& options:: +man_prologue_file () +{ + return this->man_prologue_file_; +} + +inline void options:: +man_prologue_file (const std::string& x) +{ + this->man_prologue_file_ = x; +} + +inline bool options:: +man_prologue_file_specified () const +{ + return this->man_prologue_file_specified_; +} + +inline void options:: +man_prologue_file_specified (bool x) +{ + this->man_prologue_file_specified_ = x; +} + +inline const std::string& options:: +html_prologue_file () const +{ + return this->html_prologue_file_; +} + +inline std::string& options:: +html_prologue_file () +{ + return this->html_prologue_file_; +} + +inline void options:: +html_prologue_file (const std::string& x) +{ + this->html_prologue_file_ = x; +} + +inline bool options:: +html_prologue_file_specified () const +{ + return this->html_prologue_file_specified_; +} + +inline void options:: +html_prologue_file_specified (bool x) +{ + this->html_prologue_file_specified_ = x; +} + +inline const std::string& options:: +txt_prologue_file () const +{ + return this->txt_prologue_file_; +} + +inline std::string& options:: +txt_prologue_file () +{ + return this->txt_prologue_file_; +} + +inline void options:: +txt_prologue_file (const std::string& x) +{ + this->txt_prologue_file_ = x; +} + +inline bool options:: +txt_prologue_file_specified () const +{ + return this->txt_prologue_file_specified_; +} + +inline void options:: +txt_prologue_file_specified (bool x) +{ + this->txt_prologue_file_specified_ = x; +} + +inline const std::string& options:: +hxx_epilogue_file () const +{ + return this->hxx_epilogue_file_; +} + +inline std::string& options:: +hxx_epilogue_file () +{ + return this->hxx_epilogue_file_; +} + +inline void options:: +hxx_epilogue_file (const std::string& x) +{ + this->hxx_epilogue_file_ = x; +} + +inline bool options:: +hxx_epilogue_file_specified () const +{ + return this->hxx_epilogue_file_specified_; +} + +inline void options:: +hxx_epilogue_file_specified (bool x) +{ + this->hxx_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +ixx_epilogue_file () const +{ + return this->ixx_epilogue_file_; +} + +inline std::string& options:: +ixx_epilogue_file () +{ + return this->ixx_epilogue_file_; +} + +inline void options:: +ixx_epilogue_file (const std::string& x) +{ + this->ixx_epilogue_file_ = x; +} + +inline bool options:: +ixx_epilogue_file_specified () const +{ + return this->ixx_epilogue_file_specified_; +} + +inline void options:: +ixx_epilogue_file_specified (bool x) +{ + this->ixx_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +cxx_epilogue_file () const +{ + return this->cxx_epilogue_file_; +} + +inline std::string& options:: +cxx_epilogue_file () +{ + return this->cxx_epilogue_file_; +} + +inline void options:: +cxx_epilogue_file (const std::string& x) +{ + this->cxx_epilogue_file_ = x; +} + +inline bool options:: +cxx_epilogue_file_specified () const +{ + return this->cxx_epilogue_file_specified_; +} + +inline void options:: +cxx_epilogue_file_specified (bool x) +{ + this->cxx_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +man_epilogue_file () const +{ + return this->man_epilogue_file_; +} + +inline std::string& options:: +man_epilogue_file () +{ + return this->man_epilogue_file_; +} + +inline void options:: +man_epilogue_file (const std::string& x) +{ + this->man_epilogue_file_ = x; +} + +inline bool options:: +man_epilogue_file_specified () const +{ + return this->man_epilogue_file_specified_; +} + +inline void options:: +man_epilogue_file_specified (bool x) +{ + this->man_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +html_epilogue_file () const +{ + return this->html_epilogue_file_; +} + +inline std::string& options:: +html_epilogue_file () +{ + return this->html_epilogue_file_; +} + +inline void options:: +html_epilogue_file (const std::string& x) +{ + this->html_epilogue_file_ = x; +} + +inline bool options:: +html_epilogue_file_specified () const +{ + return this->html_epilogue_file_specified_; +} + +inline void options:: +html_epilogue_file_specified (bool x) +{ + this->html_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +txt_epilogue_file () const +{ + return this->txt_epilogue_file_; +} + +inline std::string& options:: +txt_epilogue_file () +{ + return this->txt_epilogue_file_; +} + +inline void options:: +txt_epilogue_file (const std::string& x) +{ + this->txt_epilogue_file_ = x; +} + +inline bool options:: +txt_epilogue_file_specified () const +{ + return this->txt_epilogue_file_specified_; +} + +inline void options:: +txt_epilogue_file_specified (bool x) +{ + this->txt_epilogue_file_specified_ = x; +} + +inline const std::string& options:: +output_prefix () const +{ + return this->output_prefix_; +} + +inline std::string& options:: +output_prefix () +{ + return this->output_prefix_; +} + +inline void options:: +output_prefix (const std::string& x) +{ + this->output_prefix_ = x; +} + +inline bool options:: +output_prefix_specified () const +{ + return this->output_prefix_specified_; +} + +inline void options:: +output_prefix_specified (bool x) +{ + this->output_prefix_specified_ = x; +} + +inline const std::string& options:: +output_suffix () const +{ + return this->output_suffix_; +} + +inline std::string& options:: +output_suffix () +{ + return this->output_suffix_; +} + +inline void options:: +output_suffix (const std::string& x) +{ + this->output_suffix_ = x; +} + +inline bool options:: +output_suffix_specified () const +{ + return this->output_suffix_specified_; +} + +inline void options:: +output_suffix_specified (bool x) +{ + this->output_suffix_specified_ = x; +} + +inline const std::string& options:: +hxx_suffix () const +{ + return this->hxx_suffix_; +} + +inline std::string& options:: +hxx_suffix () +{ + return this->hxx_suffix_; +} + +inline void options:: +hxx_suffix (const std::string& x) +{ + this->hxx_suffix_ = x; +} + +inline bool options:: +hxx_suffix_specified () const +{ + return this->hxx_suffix_specified_; +} + +inline void options:: +hxx_suffix_specified (bool x) +{ + this->hxx_suffix_specified_ = x; +} + +inline const std::string& options:: +ixx_suffix () const +{ + return this->ixx_suffix_; +} + +inline std::string& options:: +ixx_suffix () +{ + return this->ixx_suffix_; +} + +inline void options:: +ixx_suffix (const std::string& x) +{ + this->ixx_suffix_ = x; +} + +inline bool options:: +ixx_suffix_specified () const +{ + return this->ixx_suffix_specified_; +} + +inline void options:: +ixx_suffix_specified (bool x) +{ + this->ixx_suffix_specified_ = x; +} + +inline const std::string& options:: +cxx_suffix () const +{ + return this->cxx_suffix_; +} + +inline std::string& options:: +cxx_suffix () +{ + return this->cxx_suffix_; +} + +inline void options:: +cxx_suffix (const std::string& x) +{ + this->cxx_suffix_ = x; +} + +inline bool options:: +cxx_suffix_specified () const +{ + return this->cxx_suffix_specified_; +} + +inline void options:: +cxx_suffix_specified (bool x) +{ + this->cxx_suffix_specified_ = x; +} + +inline const std::string& options:: +man_suffix () const +{ + return this->man_suffix_; +} + +inline std::string& options:: +man_suffix () +{ + return this->man_suffix_; +} + +inline void options:: +man_suffix (const std::string& x) +{ + this->man_suffix_ = x; +} + +inline bool options:: +man_suffix_specified () const +{ + return this->man_suffix_specified_; +} + +inline void options:: +man_suffix_specified (bool x) +{ + this->man_suffix_specified_ = x; +} + +inline const std::string& options:: +html_suffix () const +{ + return this->html_suffix_; +} + +inline std::string& options:: +html_suffix () +{ + return this->html_suffix_; +} + +inline void options:: +html_suffix (const std::string& x) +{ + this->html_suffix_ = x; +} + +inline bool options:: +html_suffix_specified () const +{ + return this->html_suffix_specified_; +} + +inline void options:: +html_suffix_specified (bool x) +{ + this->html_suffix_specified_ = x; +} + +inline const std::string& options:: +txt_suffix () const +{ + return this->txt_suffix_; +} + +inline std::string& options:: +txt_suffix () +{ + return this->txt_suffix_; +} + +inline void options:: +txt_suffix (const std::string& x) +{ + this->txt_suffix_ = x; +} + +inline bool options:: +txt_suffix_specified () const +{ + return this->txt_suffix_specified_; +} + +inline void options:: +txt_suffix_specified (bool x) +{ + this->txt_suffix_specified_ = x; +} + +inline const std::string& options:: +option_prefix () const +{ + return this->option_prefix_; +} + +inline std::string& options:: +option_prefix () +{ + return this->option_prefix_; +} + +inline void options:: +option_prefix (const std::string& x) +{ + this->option_prefix_ = x; +} + +inline bool options:: +option_prefix_specified () const +{ + return this->option_prefix_specified_; +} + +inline void options:: +option_prefix_specified (bool x) +{ + this->option_prefix_specified_ = x; +} + +inline const std::string& options:: +option_separator () const +{ + return this->option_separator_; +} + +inline std::string& options:: +option_separator () +{ + return this->option_separator_; +} + +inline void options:: +option_separator (const std::string& x) +{ + this->option_separator_ = x; +} + +inline bool options:: +option_separator_specified () const +{ + return this->option_separator_specified_; +} + +inline void options:: +option_separator_specified (bool x) +{ + this->option_separator_specified_ = x; +} + +inline const bool& options:: +keep_separator () const +{ + return this->keep_separator_; +} + +inline bool& options:: +keep_separator () +{ + return this->keep_separator_; +} + +inline void options:: +keep_separator (const bool& x) +{ + this->keep_separator_ = x; +} + +inline const bool& options:: +no_combined_flags () const +{ + return this->no_combined_flags_; +} + +inline bool& options:: +no_combined_flags () +{ + return this->no_combined_flags_; +} + +inline void options:: +no_combined_flags (const bool& x) +{ + this->no_combined_flags_ = x; +} + +inline const bool& options:: +no_combined_values () const +{ + return this->no_combined_values_; +} + +inline bool& options:: +no_combined_values () +{ + return this->no_combined_values_; +} + +inline void options:: +no_combined_values (const bool& x) +{ + this->no_combined_values_ = x; +} + +inline const bool& options:: +include_with_brackets () const +{ + return this->include_with_brackets_; +} + +inline bool& options:: +include_with_brackets () +{ + return this->include_with_brackets_; +} + +inline void options:: +include_with_brackets (const bool& x) +{ + this->include_with_brackets_ = x; +} + +inline const std::string& options:: +include_prefix () const +{ + return this->include_prefix_; +} + +inline std::string& options:: +include_prefix () +{ + return this->include_prefix_; +} + +inline void options:: +include_prefix (const std::string& x) +{ + this->include_prefix_ = x; +} + +inline bool options:: +include_prefix_specified () const +{ + return this->include_prefix_specified_; +} + +inline void options:: +include_prefix_specified (bool x) +{ + this->include_prefix_specified_ = x; +} + +inline const std::string& options:: +guard_prefix () const +{ + return this->guard_prefix_; +} + +inline std::string& options:: +guard_prefix () +{ + return this->guard_prefix_; +} + +inline void options:: +guard_prefix (const std::string& x) +{ + this->guard_prefix_ = x; +} + +inline bool options:: +guard_prefix_specified () const +{ + return this->guard_prefix_specified_; +} + +inline void options:: +guard_prefix_specified (bool x) +{ + this->guard_prefix_specified_ = x; +} + +inline const std::map& options:: +reserved_name () const +{ + return this->reserved_name_; +} + +inline std::map& options:: +reserved_name () +{ + return this->reserved_name_; +} + +inline void options:: +reserved_name (const std::map& x) +{ + this->reserved_name_ = x; +} + +inline bool options:: +reserved_name_specified () const +{ + return this->reserved_name_specified_; +} + +inline void options:: +reserved_name_specified (bool x) +{ + this->reserved_name_specified_ = x; +} + +inline const std::string& options:: +options_file () const +{ + return this->options_file_; +} + +inline std::string& options:: +options_file () +{ + return this->options_file_; +} + +inline void options:: +options_file (const std::string& x) +{ + this->options_file_ = x; +} + +inline bool options:: +options_file_specified () const +{ + return this->options_file_specified_; +} + +inline void options:: +options_file_specified (bool x) +{ + this->options_file_specified_ = x; +} + +// Begin epilogue. +// +// +// End epilogue. diff --git a/cli/doc/bootstrap/cli.1 b/cli/doc/bootstrap/cli.1 deleted file mode 100644 index 2c9645e..0000000 --- a/cli/doc/bootstrap/cli.1 +++ /dev/null @@ -1,423 +0,0 @@ -.\" Process this file with -.\" groff -man -Tascii cli.1 -.\" -.TH CLI 1 "January 2022" "CLI 1.2.0-b.8" -.SH NAME -cli \- command line interface compiler for C++ -.\" -.\" -.\" -.\"-------------------------------------------------------------------- -.SH SYNOPSIS -.\"-------------------------------------------------------------------- -.B cli -.B [ -.I options -.B ] -.I file -.\" -.\" -.\" -.\"-------------------------------------------------------------------- -.SH DESCRIPTION -.\"-------------------------------------------------------------------- -.B cli -generates C++ implementation and documentation in various formats for a -command line interface defined in the CLI language. For an input file in -the form -.B name.cli -the following is generated. By default or if the -.B --generate-cxx -option is specified, the following C++ files are generated: -.B name.hxx -(header file), -.B name.ixx -(inline file, generated unless the -.B --suppress-inline -option is specified), and -.B name.cxx (source file). -If the -.B --generate-html -option is specified, then the -.B name.html -HTML documentation file is generated. If the -.B --generate-man -option is specified, then the -.B name.1 -man page file is generated. When -.B --generate-html -or -.B --generate-man -is specified, the -.B --stdout -option can be used to redirect the output to STDOUT instead of a file. -.\" -.\" -.\" -.\"-------------------------------------------------------------------- -.SH OPTIONS -.\"-------------------------------------------------------------------- -.IP "\fB--help\fR" -Print usage information and exit\. -.IP "\fB--version\fR" -Print version and exit\. -.IP "\fB--include-path\fR|\fB-I\fR \fIdir\fR" -Search \fIdir\fR for bracket-included (\fB<>\fR) options files\. -.IP "\fB--output-dir\fR|\fB-o\fR \fIdir\fR" -Write the generated files to \fIdir\fR instead of the current directory\. -.IP "\fB--std\fR \fIversion\fR" -Specify the C++ standard that should be used during compilation\. Valid values -are \fBc++98\fR (default), \fBc++11\fR, and \fBc++14\fR\. -.IP "\fB--generate-modifier\fR" -Generate option value modifiers in addition to accessors\. -.IP "\fB--generate-specifier\fR" -Generate functions for determining whether the option was specified on the -command line\. -.IP "\fB--generate-parse\fR" -Generate \fBparse()\fR 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 option appending/overriding\. -.IP "\fB--generate-merge\fR" -Generate \fBmerge()\fR functions\. This is primarily useful for being able to -merge several already parsed options class instances, for example, to -implement option appending/overriding\. Note that this option forces -\fB--generate-specifier\fR\. -.IP "\fB--generate-description\fR" -Generate the option description list that can be examined at runtime\. -.IP "\fB--generate-file-scanner\fR" -Generate the \fBargv_file_scanner\fR implementation\. This scanner is capable -of reading command line arguments from the \fBargv\fR array as well as files -specified with command line options\. -.IP "\fB--generate-vector-scanner\fR" -Generate the \fBvector_scanner\fR implementation\. This scanner is capable of -reading command line arguments from \fBvector\fR\. -.IP "\fB--generate-group-scanner\fR" -Generate the \fBgroup_scanner\fR implementation\. This scanner supports -grouping of arguments (usually options) to apply only to a certain argument\. - -Groups can be specified before (leading) and/or after (trailing) the argument -they apply to\. A leading group starts with '\fB{\fR' and ends with '\fB}+\fR' -while a trailing group starts with '\fB+{\fR' and ends with '\fB}\fR'\. For -example: - -.nf -{ --foo --bar }+ arg # 'arg' with '--foo' '--bar' -arg +{ fox=1 baz=2 } # 'arg' with 'fox=1' 'baz=2' -.fi - -Multiple leading and/or trailing groups can be specified for the same -argument\. For example: - -.nf -{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2' -.fi - -The group applies to a single argument only unless multiple arguments are -themselves grouped with '\fB{\fR' and '\fB}\fR'\. For example: - -.nf -{ --foo }+ arg1 arg2 +{ --bar } # 'arg1' with '--foo' - # 'arg2' with '--bar' - -{ --foo }+ { arg1 arg2 } +{ --bar } # 'arg1' with '--foo' '--bar' - # 'arg2' with '--foo' '--bar' -.fi - -The group separators ('\fB{\fR', '\fB}+'\fR, etc) must be separate command -line arguments\. In particular, they must not be adjacent either to the -arguments inside the group nor to the argument they apply to\. All such cases -will be treated as ordinary arguments\. For example: - -.nf -{--foo}+ arg # '{--foo}+' \.\.\. -arg+{ --foo } # 'arg+{' \.\.\. -.fi - -If one of the group separators needs to be specified as an argument verbatim, -then it must be escaped with '\fB\e\fR'\. For example: - -.nf -} # error: unexpected group separator -}x # '}x' -\\} # '}' -{ \\}+ }+ arg # 'arg' with '}+' -.fi -.IP "\fB--suppress-inline\fR" -Generate all functions non-inline\. By default simple functions are made -inline\. This option suppresses creation of the inline file\. -.IP "\fB--suppress-cli\fR" -Do not generate the CLI support types (scanners, parser, etc)\. Normally, the -support types are generated unless another \fB\.cli\fR was included, in which -case the support types are expected to be provided by its generated code\. -.IP "\fB--cli-namespace\fR \fIns\fR" -Generate the CLI support types in the \fIns\fR namespace (\fBcli\fR by -default)\. The namespace can be nested, for example \fBdetails::cli\fR\. If -the namespace is empty, then the support types are generated in the global -namespace\. -.IP "\fB--ostream-type\fR \fItype\fR" -Output stream type instead of the default \fBstd::ostream\fR that should be -used to print usage and exception information\. -.IP "\fB--export-symbol\fR \fIsymbol\fR" -Insert \fIsymbol\fR in places where DLL export/import control statements -(\fB__declspec(dllexport/dllimport)\fR) are necessary\. -.IP "\fB--generate-cxx\fR" -Generate C++ code\. If neither \fB--generate-man\fR, \fB--generate-html\fR, -nor \fB--generate-txt\fR is specified, this mode is assumed by default\. -.IP "\fB--generate-man\fR" -Generate documentation in the man page format\. -.IP "\fB--generate-html\fR" -Generate documentation in the HTML format\. -.IP "\fB--generate-txt\fR" -Generate documentation in the plain text format, similar to usage\. -.IP "\fB--stdout\fR" -Write output to STDOUT instead of a file\. This option is not valid when -generating C++ code and is normally used to combine generated documentation -for several option classes in a single file\. -.IP "\fB--suppress-undocumented\fR" -Suppress the generation of documentation entries for undocumented options\. -.IP "\fB--suppress-usage\fR" -Suppress the generation of the usage printing code\. -.IP "\fB--long-usage\fR" -If no short documentation string is provided, use the complete long -documentation string in usage\. By default, in this situation only the first -sentence from the long string is used\. -.IP "\fB--short-usage\fR" -If specified together with \fB--long-usage\fR, generate both short and long -usage versions\. In this mode, the long usage printing function is called -\fBprint_long_usage()\fR and in its implementation the long documentation -string is always used, even if the short version is provided\. -.IP "\fB--page-usage\fR \fIname\fR" -Generate the combined usage printing code for the entire page\. Specifically, -this will include all the namespace-level documentation as well as usage for -all the options classes printed in the order they are defined in the main -translation unit (documentation/classes from included units are ignored except -for base classes)\. - -The \fIname\fR argument is used as a prefix to form the name of the usage -printing function\. It can include the namespace qualification as well as -documentation variable expansion, for example: - -.nf ---page-usage print_ # print_usage() in global namespace ---page-usage app::print_ # print_usage() in app namespace ---page-usage print_$name$_ # print_foo_usage() if name is foo -.fi - -If both \fB--long-usage\fR and \fB--short-usage\fR options are specified, then -the long usage function has the \fB*long_usage()\fR suffix\. -.IP "\fB--option-length\fR \fIlen\fR" -Indent option descriptions \fIlen\fR characters when printing usage\. This is -useful when you have multiple options classes, potentially in separate files, -and would like their usage to have the same indentation level\. -.IP "\fB--ascii-tree\fR" -Convert UTF-8 \fBtree(1)\fR output to ASCII\. Specifically, box-drawing -characters used in the \fB--charset=UTF-8\fR output are replaced with ASCII -characters used in the \fB--charset=ASCII\fR output\. -.IP "\fB--ansi-color\fR" -Use ANSI color escape sequences when printing usage\. By "color" we really -only mean the bold and underline modifiers\. Note that Windows console does -not recognize ANSI escape sequences and will display them as garbage\. -However, if you pipe such output through \fBless(1)\fR, it will display them -correctly\. -.IP "\fB--exclude-base\fR" -Exclude base class information from usage and documentation\. -.IP "\fB--include-base-last\fR" -Include base class information after derived for usage and documentation\. By -default, base classes are included first\. -.IP "\fB--class-doc\fR \fIname\fR=\fIkind\fR" -Specify the documentation \fIkind\fR that should be used for the options class -\fIname\fR\. The \fIname\fR value should be a fully-qualified class name, for -example, \fBapp::options\fR\. The \fIkind\fR value can be \fBshort\fR, -\fBlong\fR, \fBexclude\fR, or \fBexclude-base\fR\. If the value is -\fBexclude\fR, then the class documentation is excluded from usage and -man/HTML/text output\. If it is \fBexclude-base\fR, then it is only excluded -when used as a base\. For usage, the \fBshort\fR and \fBlong\fR values -determine which usage function will be called when the class is used as base -or as part of the page usage (see \fB--page-usage\fR)\. For man/HTML/text, -these values determine which documentation strings are used in the output\. -.IP "\fB--class\fR \fIname\fR" -Generate the man page, HTML, or text documentation only for the options class -\fIname\fR\. The \fIname\fR value should be a fully-qualified options class -name, for example, \fBapp::options\fR\. To generate documentation for multiple -classes, repeat this option and the documentation will be produced in the -order specified\. This functionality is useful if you need to assemble -documentation from multiple classes in a specific order or to insert custom -documentation between options belonging to different classes\. -.IP "\fB--docvar\fR|\fB-v\fR \fIname\fR=\fIval\fR" -Set documentation variable \fIname\fR to the value \fIval\fR\. Documentation -variables can be substituted in prologues and epilogues (see -\fB--*-prologue*\fR and \fB--*-epilogue*\fR options) using the -\fB$\fR\fIname\fR\fB$\fR expansion syntax (use \fB$$\fR to escape expansion)\. -They can also be defined in \fB\.cli\fR files using the -\&"\e\fIname\fR=\fIval\fR"\fR syntax\. -.IP "\fB--link-regex\fR \fIregex\fR" -Add \fIregex\fR to the list of regular expressions used to transform link -targets in the generated documentation\. The argument to this option is a -Perl-like regular expression in the form -\fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any character can be -used as a delimiter instead of '\fB/\fR' and the delimiter can be escaped -inside \fIpattern\fR and \fIreplacement\fR with a backslash (\fB\e\fR)\. You -can specify multiple regular expressions by repeating this option\. All the -regular expressions are tried in the order specified and the first expression -that matches is used\. Use the \fB--link-regex-trace\fR option to debug link -transformation\. -.IP "\fB--link-regex-trace\fR" -Trace the process of applying regular expressions specified with the -\fB--link-regex\fR option\. Use this option to find out why your regular -expressions don't do what you expected them to do\. -.IP "\fB--html-heading-map\fR \fIc\fR=\fIh\fR" -Map CLI heading \fIc\fR (valid values: '\fBH\fR', '\fB0\fR', '\fB1\fR', -\&'\fBh\fR', and '\fB2\fR') to HTML heading \fIh\fR (for example, '\fBh1\fR', -\&'\fBh2\fR', etc)\. -.IP "\fB--omit-link-check\fR" -Don't check that local fragment link references (\el{#ref \.\.\.}) resolve to -ids\. -.IP "\fB--hxx-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated C++ header file\. -.IP "\fB--ixx-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated C++ inline file\. -.IP "\fB--cxx-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated C++ source file\. -.IP "\fB--man-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated man page file\. -.IP "\fB--html-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated HTML file\. -.IP "\fB--txt-prologue\fR \fItext\fR" -Insert \fItext\fR at the beginning of the generated text file\. -.IP "\fB--hxx-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated C++ header file\. -.IP "\fB--ixx-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated C++ inline file\. -.IP "\fB--cxx-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated C++ source file\. -.IP "\fB--man-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated man page file\. -.IP "\fB--html-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated HTML file\. -.IP "\fB--txt-epilogue\fR \fItext\fR" -Insert \fItext\fR at the end of the generated text file\. -.IP "\fB--hxx-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated C++ header -file\. -.IP "\fB--ixx-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated C++ inline -file\. -.IP "\fB--cxx-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated C++ source -file\. -.IP "\fB--man-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated man page -file\. -.IP "\fB--html-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated HTML file\. -.IP "\fB--txt-prologue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the beginning of the generated text file\. -.IP "\fB--hxx-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated C++ header file\. -.IP "\fB--ixx-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated C++ inline file\. -.IP "\fB--cxx-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated C++ source file\. -.IP "\fB--man-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated man page file\. -.IP "\fB--html-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated HTML file\. -.IP "\fB--txt-epilogue-file\fR \fIfile\fR" -Insert the content of \fIfile\fR at the end of the generated text file\. -.IP "\fB--output-prefix\fR \fIprefix\fR" -Add \fIprefix\fR at the beginning of the generated output file name(s)\. -.IP "\fB--output-suffix\fR \fIsuffix\fR" -Add \fIsuffix\fR at the end of the generated output file name(s)\. Note that -it is added before any file type-specific suffixes; see \fB--*-suffix\fR -below\. -.IP "\fB--hxx-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.hxx\fR to construct the name of -the generated header file\. -.IP "\fB--ixx-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.ixx\fR to construct the name of -the generated inline file\. -.IP "\fB--cxx-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.cxx\fR to construct the name of -the generated source file\. -.IP "\fB--man-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.1\fR to construct the name of the -generated man page file\. -.IP "\fB--html-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.html\fR to construct the name of -the generated HTML file\. -.IP "\fB--txt-suffix\fR \fIsuffix\fR" -Use \fIsuffix\fR instead of the default \fB\.txt\fR to construct the name of -the generated text file\. -.IP "\fB--option-prefix\fR \fIprefix\fR" -Use \fIprefix\fR instead of the default '\fB-\fR' as an option prefix\. -Unknown command line arguments that start with this prefix are treated as -unknown options\. If you set the option prefix to the empty value, then all -the unknown command line arguments will be treated as program arguments\. -.IP "\fB--option-separator\fR \fIsep\fR" -Use \fIsep\fR instead of the default '\fB--\fR' as an optional separator -between options and arguments\. All the command line arguments that are parsed -after this separator are treated as program arguments\. Set the option -separator to the empty value if you don't want this functionality\. -.IP "\fB--keep-separator\fR" -Leave the option separator in the scanner\. This is primarily useful for -incremental option parsing\. -.IP "\fB--no-combined-flags\fR" -Disable support for combining multiple single-character flags into a single -argument (the \fB-xyz\fR form that is equivalent to \fB-x\fR \fB-y\fR -\fB-z\fR)\. An argument is considered a combination of flags if it starts with -a single option prefix (\fB--option-prefix\fR) and only contains letters and -digits\. Note that an option with a value may not be part of such a -combination, not even if it is specified last\. -.IP "\fB--no-combined-values\fR" -Disable support for combining an option and its value into a single argument -with the assignment sign (the \fIoption\fR\fB=\fR\fIvalue\fR\fR form)\. This -functionality requires a non-empty option prefix (\fB--option-prefix\fR)\. -.IP "\fB--include-with-brackets\fR" -Use angle brackets (\fB<>\fR) instead of quotes (\fB""\fR) in the generated -\fB#include\fR directives\. -.IP "\fB--include-prefix\fR \fIprefix\fR" -Add \fIprefix\fR to the generated \fB#include\fR directive paths\. -.IP "\fB--guard-prefix\fR \fIprefix\fR" -Add \fIprefix\fR to the generated header inclusion guards\. The prefix is -transformed to upper case and characters that are illegal in a preprocessor -macro name are replaced with underscores\. -.IP "\fB--reserved-name\fR \fIname\fR=\fIrep\fR" -Add \fIname\fR with an optional \fIrep\fR replacement to the list of names -that should not be used as identifiers\. If provided, the replacement name is -used instead\. All C++ keywords are already in this list\. -.IP "\fB--options-file\fR \fIfile\fR" -Read additional options from \fIfile\fR\. Each option should appear on a -separate line optionally followed by space or equal sign (\fB=\fR) and an -option value\. Empty lines and lines starting with \fB#\fR are ignored\. -Option values can be enclosed in double (\fB"\fR) or single (\fB'\fR) quotes -to preserve leading and trailing whitespaces as well as to specify empty -values\. If the value itself contains trailing or leading quotes, enclose it -with an extra pair of quotes, for example \fB'"x"'\fR\. Non-leading and -non-trailing quotes are interpreted as being part of the option value\. - -The semantics of providing options in a file is equivalent to providing the -same set of options in the same order on the command line at the point where -the \fB--options-file\fR option is specified except that the shell escaping -and quoting is not required\. Repeat this option to specify more than one -options file\. -.\" -.\" DIAGNOSTICS -.\" -.SH DIAGNOSTICS -If the input file is not a valid CLI definition, -.B cli -will issue diagnostic messages to STDERR and exit with non-zero exit code. -.\" -.\" BUGS -.\" -.SH BUGS -Send bug reports to the cli-users@codesynthesis.com mailing list. -.\" -.\" COPYRIGHT -.\" -.SH COPYRIGHT -Copyright (c) 2009-2022 Code Synthesis Tools CC. - -Permission is granted to copy, distribute and/or modify this document under -the terms of the MIT License. Copy of this license can be obtained from -http://www.codesynthesis.com/licenses/mit.txt diff --git a/cli/doc/bootstrap/cli.xhtml b/cli/doc/bootstrap/cli.xhtml deleted file mode 100644 index 96dc913..0000000 --- a/cli/doc/bootstrap/cli.xhtml +++ /dev/null @@ -1,584 +0,0 @@ - - - - - CLI 1.2.0-b.8 Compiler Command Line Manual - - - - - - - - - - - -
-
- -

NAME

- -

cli - command line interface compiler for C++

- -

SYNOPSIS

- -
-
cli [options] file
-
- -

DESCRIPTION

- -

cli generates C++ implementation and - documentation in various formats for a command line interface - defined in the CLI language. For an input file in the form - name.cli the following is generated. By - default or if the --generate-cxx option is - specified, the following C++ files are generated: - name.hxx (header file), name.ixx - (inline file, generated unless the --suppress-inline - option is specified), and name.cxx (source file). - If the --generate-html option is specified, then - the name.html HTML documentation file is generated. - If the --generate-man option is specified, then - the name.1 man page file is generated. When - --generate-html or --generate-man - is specified, the --stdout option can be used to - redirect the output to STDOUT instead of a file.

- -

OPTIONS

-
-
--help
-
Print usage information and exit.
- -
--version
-
Print version and exit.
- -
--include-path|-I dir
-
Search dir for bracket-included - (<>) options files.
- -
--output-dir|-o dir
-
Write the generated files to dir instead of the - current directory.
- -
--std version
-
Specify the C++ standard that should be used during compilation. Valid - values are c++98 (default), c++11, - and c++14.
- -
--generate-modifier
-
Generate option value modifiers in addition to accessors.
- -
--generate-specifier
-
Generate functions for determining whether the option was specified on - the command line.
- -
--generate-parse
-
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 - option appending/overriding.
- -
--generate-merge
-
Generate merge() functions. This is primarily - useful for being able to merge several already parsed options class - instances, for example, to implement option appending/overriding. Note - that this option forces --generate-specifier.
- -
--generate-description
-
Generate the option description list that can be examined at - runtime.
- -
--generate-file-scanner
-
Generate the argv_file_scanner implementation. - This scanner is capable of reading command line arguments from the - argv array as well as files specified with command - line options.
- -
--generate-vector-scanner
-
Generate the vector_scanner implementation. This - scanner is capable of reading command line arguments from - vector<string>.
- -
--generate-group-scanner
-
Generate the group_scanner implementation. This - scanner supports grouping of arguments (usually options) to apply only to - a certain argument. - -

Groups can be specified before (leading) and/or after (trailing) the - argument they apply to. A leading group starts with - '{' and ends with '}+' while a - trailing group starts with '+{' and ends with - '}'. For example:

- -
{ --foo --bar }+ arg   # 'arg' with '--foo' '--bar'
-arg +{ fox=1 baz=2 }   # 'arg' with 'fox=1' 'baz=2'
- -

Multiple leading and/or trailing groups can be specified for the same - argument. For example:

- -
{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2'
- -

The group applies to a single argument only unless multiple arguments - are themselves grouped with '{' and - '}'. For example:

- -
{ --foo }+ arg1  arg2 +{ --bar }      # 'arg1' with '--foo'
-                                      # 'arg2' with '--bar'
-
-{ --foo }+ { arg1  arg2 } +{ --bar }  # 'arg1' with '--foo' '--bar'
-                                      # 'arg2' with '--foo' '--bar'
- -

The group separators ('{', - '}+', etc) must be separate command line arguments. In - particular, they must not be adjacent either to the arguments inside the - group nor to the argument they apply to. All such cases will be treated as - ordinary arguments. For example:

- -
{--foo}+ arg   # '{--foo}+' ...
-arg+{ --foo }  # 'arg+{' ...
- -

If one of the group separators needs to be specified as an argument - verbatim, then it must be escaped with '\'. For - example:

- -
}             # error: unexpected group separator
-}x            # '}x'
-\}            # '}'
-{ \}+ }+ arg  # 'arg' with '}+'
- -
--suppress-inline
-
Generate all functions non-inline. By default simple functions are - made inline. This option suppresses creation of the inline file.
- -
--suppress-cli
-
Do not generate the CLI support types (scanners, parser, etc). - Normally, the support types are generated unless another - .cli was included, in which case the support types are - expected to be provided by its generated code.
- -
--cli-namespace ns
-
Generate the CLI support types in the ns namespace - (cli by default). The namespace can be nested, for - example details::cli. If the namespace is empty, then - the support types are generated in the global namespace.
- -
--ostream-type type
-
Output stream type instead of the default - std::ostream that should be used to print usage and - exception information.
- -
--export-symbol symbol
-
Insert symbol in places where DLL export/import - control statements (__declspec(dllexport/dllimport)) - are necessary.
- -
--generate-cxx
-
Generate C++ code. If neither --generate-man, - --generate-html, nor - --generate-txt is specified, this mode is assumed by - default.
- -
--generate-man
-
Generate documentation in the man page format.
- -
--generate-html
-
Generate documentation in the HTML format.
- -
--generate-txt
-
Generate documentation in the plain text format, similar to - usage.
- -
--stdout
-
Write output to STDOUT instead of a file. This option is not valid - when generating C++ code and is normally used to combine generated - documentation for several option classes in a single file.
- -
--suppress-undocumented
-
Suppress the generation of documentation entries for undocumented - options.
- -
--suppress-usage
-
Suppress the generation of the usage printing code.
- -
--long-usage
-
If no short documentation string is provided, use the complete long - documentation string in usage. By default, in this situation only the - first sentence from the long string is used.
- -
--short-usage
-
If specified together with --long-usage, generate - both short and long usage versions. In this mode, the long usage printing - function is called print_long_usage() and in its - implementation the long documentation string is always used, even if the - short version is provided.
- -
--page-usage name
-
Generate the combined usage printing code for the entire page. - Specifically, this will include all the namespace-level documentation as - well as usage for all the options classes printed in the order they are - defined in the main translation unit (documentation/classes from included - units are ignored except for base classes). - -

The name argument is used as a prefix to form the - name of the usage printing function. It can include the namespace - qualification as well as documentation variable expansion, for - example:

- -
--page-usage print_         # print_usage() in global namespace
---page-usage app::print_    # print_usage() in app namespace
---page-usage print_$name$_  # print_foo_usage() if name is foo
- -

If both --long-usage and - --short-usage options are specified, then the long - usage function has the *long_usage() suffix.

- -
--option-length len
-
Indent option descriptions len characters when - printing usage. This is useful when you have multiple options classes, - potentially in separate files, and would like their usage to have the same - indentation level.
- -
--ascii-tree
-
Convert UTF-8 tree(1) output to ASCII. - Specifically, box-drawing characters used in the - --charset=UTF-8 output are replaced with ASCII - characters used in the --charset=ASCII output.
- -
--ansi-color
-
Use ANSI color escape sequences when printing usage. By "color" we - really only mean the bold and underline modifiers. Note that Windows - console does not recognize ANSI escape sequences and will display them as - garbage. However, if you pipe such output through - less(1), it will display them correctly.
- -
--exclude-base
-
Exclude base class information from usage and documentation.
- -
--include-base-last
-
Include base class information after derived for usage and - documentation. By default, base classes are included first.
- -
--class-doc name=kind
-
Specify the documentation kind that should be used - for the options class name. The - name value should be a fully-qualified class name, for - example, app::options. The kind - value can be short, long, - exclude, or exclude-base. If the - value is exclude, then the class documentation is - excluded from usage and man/HTML/text output. If it is - exclude-base, then it is only excluded when used as a - base. For usage, the short and - long values determine which usage function will be - called when the class is used as base or as part of the page usage (see - --page-usage). For man/HTML/text, these values - determine which documentation strings are used in the output.
- -
--class name
-
Generate the man page, HTML, or text documentation only for the - options class name. The name value - should be a fully-qualified options class name, for example, - app::options. To generate documentation for multiple - classes, repeat this option and the documentation will be produced in the - order specified. This functionality is useful if you need to assemble - documentation from multiple classes in a specific order or to insert - custom documentation between options belonging to different classes.
- -
--docvar|-v name=val
-
Set documentation variable name to the value - val. Documentation variables can be substituted in - prologues and epilogues (see --*-prologue* and - --*-epilogue* options) using the - $name$ - expansion syntax (use $$ to escape expansion). They - can also be defined in .cli files using the - "\name=val" - syntax.
- -
--link-regex regex
-
Add regex to the list of regular expressions used - to transform link targets in the generated documentation. The argument to - this option is a Perl-like regular expression in the form - /pattern/replacement/. Any - character can be used as a delimiter instead of '/' - and the delimiter can be escaped inside pattern and - replacement with a backslash (\). - You can specify multiple regular expressions by repeating this option. All - the regular expressions are tried in the order specified and the first - expression that matches is used. Use the - --link-regex-trace option to debug link - transformation.
- -
--link-regex-trace
-
Trace the process of applying regular expressions specified with the - --link-regex option. Use this option to find out why - your regular expressions don't do what you expected them to do.
- -
--html-heading-map c=h
-
Map CLI heading c (valid values: - 'H', '0', '1', - 'h', and '2') to HTML heading - h (for example, 'h1', - 'h2', etc).
- -
--omit-link-check
-
Don't check that local fragment link references (\l{#ref ...}) resolve - to ids.
- -
--hxx-prologue text
-
Insert text at the beginning of the generated C++ - header file.
- -
--ixx-prologue text
-
Insert text at the beginning of the generated C++ - inline file.
- -
--cxx-prologue text
-
Insert text at the beginning of the generated C++ - source file.
- -
--man-prologue text
-
Insert text at the beginning of the generated man - page file.
- -
--html-prologue text
-
Insert text at the beginning of the generated HTML - file.
- -
--txt-prologue text
-
Insert text at the beginning of the generated text - file.
- -
--hxx-epilogue text
-
Insert text at the end of the generated C++ header - file.
- -
--ixx-epilogue text
-
Insert text at the end of the generated C++ inline - file.
- -
--cxx-epilogue text
-
Insert text at the end of the generated C++ source - file.
- -
--man-epilogue text
-
Insert text at the end of the generated man page - file.
- -
--html-epilogue text
-
Insert text at the end of the generated HTML - file.
- -
--txt-epilogue text
-
Insert text at the end of the generated text - file.
- -
--hxx-prologue-file file
-
Insert the content of file at the beginning of the - generated C++ header file.
- -
--ixx-prologue-file file
-
Insert the content of file at the beginning of the - generated C++ inline file.
- -
--cxx-prologue-file file
-
Insert the content of file at the beginning of the - generated C++ source file.
- -
--man-prologue-file file
-
Insert the content of file at the beginning of the - generated man page file.
- -
--html-prologue-file file
-
Insert the content of file at the beginning of the - generated HTML file.
- -
--txt-prologue-file file
-
Insert the content of file at the beginning of the - generated text file.
- -
--hxx-epilogue-file file
-
Insert the content of file at the end of the - generated C++ header file.
- -
--ixx-epilogue-file file
-
Insert the content of file at the end of the - generated C++ inline file.
- -
--cxx-epilogue-file file
-
Insert the content of file at the end of the - generated C++ source file.
- -
--man-epilogue-file file
-
Insert the content of file at the end of the - generated man page file.
- -
--html-epilogue-file file
-
Insert the content of file at the end of the - generated HTML file.
- -
--txt-epilogue-file file
-
Insert the content of file at the end of the - generated text file.
- -
--output-prefix prefix
-
Add prefix at the beginning of the generated - output file name(s).
- -
--output-suffix suffix
-
Add suffix at the end of the generated output file - name(s). Note that it is added before any file type-specific suffixes; see - --*-suffix below.
- -
--hxx-suffix suffix
-
Use suffix instead of the default - .hxx to construct the name of the generated header - file.
- -
--ixx-suffix suffix
-
Use suffix instead of the default - .ixx to construct the name of the generated inline - file.
- -
--cxx-suffix suffix
-
Use suffix instead of the default - .cxx to construct the name of the generated source - file.
- -
--man-suffix suffix
-
Use suffix instead of the default - .1 to construct the name of the generated man page - file.
- -
--html-suffix suffix
-
Use suffix instead of the default - .html to construct the name of the generated HTML - file.
- -
--txt-suffix suffix
-
Use suffix instead of the default - .txt to construct the name of the generated text - file.
- -
--option-prefix prefix
-
Use prefix instead of the default - '-' as an option prefix. Unknown command line - arguments that start with this prefix are treated as unknown options. If - you set the option prefix to the empty value, then all the unknown command - line arguments will be treated as program arguments.
- -
--option-separator sep
-
Use sep instead of the default - '--' as an optional separator between options and - arguments. All the command line arguments that are parsed after this - separator are treated as program arguments. Set the option separator to - the empty value if you don't want this functionality.
- -
--keep-separator
-
Leave the option separator in the scanner. This is primarily useful - for incremental option parsing.
- -
--no-combined-flags
-
Disable support for combining multiple single-character flags into a - single argument (the -xyz form that is equivalent to - -x -y -z). An - argument is considered a combination of flags if it starts with a single - option prefix (--option-prefix) and only contains - letters and digits. Note that an option with a value may not be part of - such a combination, not even if it is specified last.
- -
--no-combined-values
-
Disable support for combining an option and its value into a single - argument with the assignment sign (the - option=value form). This functionality - requires a non-empty option prefix - (--option-prefix).
- -
--include-with-brackets
-
Use angle brackets (<>) instead of quotes - ("") in the generated #include - directives.
- -
--include-prefix prefix
-
Add prefix to the generated - #include directive paths.
- -
--guard-prefix prefix
-
Add prefix to the generated header inclusion - guards. The prefix is transformed to upper case and characters that are - illegal in a preprocessor macro name are replaced with underscores.
- -
--reserved-name name=rep
-
Add name with an optional rep - replacement to the list of names that should not be used as identifiers. - If provided, the replacement name is used instead. All C++ keywords are - already in this list.
- -
--options-file file
-
Read additional options from file. Each option - should appear on a separate line optionally followed by space or equal - sign (=) and an option value. Empty lines and lines - starting with # are ignored. Option values can be - enclosed in double (") or single - (') quotes to preserve leading and trailing - whitespaces as well as to specify empty values. If the value itself - contains trailing or leading quotes, enclose it with an extra pair of - quotes, for example '"x"'. Non-leading and - non-trailing quotes are interpreted as being part of the option value. - -

The semantics of providing options in a file is equivalent to providing - the same set of options in the same order on the command line at the point - where the --options-file option is specified except - that the shell escaping and quoting is not required. Repeat this option to - specify more than one options file.

-
- -

DIAGNOSTICS

- -

If the input file is not a valid CLI definition, cli - will issue diagnostic messages to STDERR and exit with non-zero exit - code.

- -

BUGS

- -

Send bug reports to the - cli-users@codesynthesis.com mailing list.

- -
- -
- - diff --git a/cli/doc/buildfile b/cli/doc/buildfile index 09202ad..61dfd4f 100644 --- a/cli/doc/buildfile +++ b/cli/doc/buildfile @@ -16,15 +16,37 @@ pdf{*}: extension = pdf define html2ps: file html2ps{*}: extension = html2ps -./: css{default} xhtml{cli-guide} bootstrap/{man1 xhtml}{cli} +./: css{default} xhtml{cli-guide} -if $config.cli.develop +# Man pages. +# + +## Consumption build ($develop == false). +# + +# Use pregenerated versions in the consumption build. +# +./: pregenerated/{man1 xhtml}{*}: include = (!$develop) + +# Distribute pregenerated versions only in the consumption build. +# +pregenerated/{man1 xhtml}{*}: dist = (!$develop) + +# +## + +## Development build ($develop == true). +# + +./: {man1 xhtml}{cli}: include = $develop + +if $develop { doc_version = [string] "$version.major\.$version.minor\.$version.patch" if $version.pre_release doc_version += "-$version.pre_release_string" - # Let's take the last for-digit number to cover 2000-2021,2022. + # Let's take the last four-digit number to cover 2000-2021,2022. # doc_year = $regex.replace($copyright, '.+[-, ]([0-9][0-9][0-9][0-9]) .+', '\1') @@ -33,87 +55,142 @@ if $config.cli.develop # We use the cli version we've built to generate the documentation. # - # Note: avoid cleaning it through this dependency. - # include ../cli/ +} + +# Note: avoid cleaning exe{cli} through this dependency. +# +{man1 xhtml}{cli}: ../cli/exe{cli}: clean = false - {xhtml man1}{cli}: ../cli/exe{cli}: clean = false - - ./: man1{cli}: ../cli/cli{options} file{cli-prologue.1 cli-epilogue.1} - {{ - diag cli --man ($<[1]) - - # Use the copyright year to approximate the last authoring date. - # - ($<[0]) --generate-man $man_options \ - -v date="January $doc_year" \ - --man-prologue-file $path($<[2]) \ - --man-epilogue-file $path($<[3]) \ - --stdout $path($<[1]) >$path($>) - - # If the result differs from the bootstrap version, copy it over. Unlike - # the bootstrap cli case, here we don't need to cause a build restart. - # - if! diff $src_base/bootstrap/cli.1 $path($>) >- - cp $path($>) $src_base/bootstrap/cli.1 - end - }} - - ./: xhtml{cli}: $src_root/cli/cli{options} \ - file{cli-prologue.xhtml cli-epilogue.xhtml} - {{ - diag cli --html ($<[1]) - - ($<[0]) --generate-html $man_options \ - --html-prologue-file $path($<[2]) \ - --html-epilogue-file $path($<[3]) \ - --stdout $path($<[1]) >$path($>) - - if! diff $src_base/bootstrap/cli.xhtml $path($>) >- - cp $path($>) $src_base/bootstrap/cli.xhtml - end - }} +# In the development build distribute regenerated versions, remapping their +# locations to the paths of the pregenerated versions (which are only +# distributed in the consumption build; see above). This way we make sure that +# the distributed files are always up-to-date. +# +{man1 xhtml}{cli}: dist = ($develop ? pregenerated/ : false) +man1{cli}: ../cli/cli{options} file{cli-prologue.1 cli-epilogue.1} +% +if $develop +{{ + diag cli --man ($<[1]) + + # Use the copyright year to approximate the last authoring date. + # + ($<[0]) --generate-man $man_options \ + -v date="January $doc_year" \ + --man-prologue-file $path($<[2]) \ + --man-epilogue-file $path($<[3]) \ + --stdout $path($<[1]) >$path($>) + + # If the result differs from the pregenerated version, copy it over. Unlike + # the bootstrap compiler case, here we don't need to cause a build restart + # (since nothing depends on it). + # + if! diff $src_base/pregenerated/cli.1 $path($>) >- + cp $path($>) $src_base/pregenerated/cli.1 + end +}} + +xhtml{cli}: ../cli/cli{options} file{cli-prologue.xhtml cli-epilogue.xhtml} +% +if $develop +{{ + diag cli --html ($<[1]) + + ($<[0]) --generate-html $man_options \ + --html-prologue-file $path($<[2]) \ + --html-epilogue-file $path($<[3]) \ + --stdout $path($<[1]) >$path($>) + + if! diff $src_base/pregenerated/cli.xhtml $path($>) >- + cp $path($>) $src_base/pregenerated/cli.xhtml + end +}} + +# +## + +# Manual. +# +# This case is slightly more involved because we make the generation of the +# manual's ps/pdf optional and also don't keep the result in the repository. +# Specifically: +# +# 1. In the consumption build we will install/redistribute ps/pdf if present. +# +# 2. In the development build we will generate ps/pdf if we are able to import +# the needed tools, issuing a warning otherwise. + +## Consumption build ($develop == false). +# + +# Use pregenerated versions, if exist, in the consumption build. +# +./: pregenerated/{ps pdf}{*}: include = (!$develop) + +# Distribute pregenerated versions only in the consumption build. +# +pregenerated/{ps pdf}{*}: dist = (!$develop) + +# +## + +## Development build ($develop == true). +# + +html2pdf = false + +if $develop +{ # Import the html2ps and ps2pdf programs from the system, if available. # import? html2ps = html2ps%exe{html2ps} import? ps2pdf = ps2pdf14%exe{ps2pdf14} - if ($html2ps != [null] && $ps2pdf != [null]) - { - # Note that we include these generated files into the distribution and - # don't remove them when cleaning in src (so that clean results in a state - # identical to distributed). - # - ./: ps{cli-guide}: xhtml{cli-guide} html2ps{guide} $html2ps - { - options = - - dist = true - clean = ($src_root != $out_root) - } - {{ - diag html2ps ($<[0]) - $html2ps $options -f $path($<[1]) -o $path($>) $path($<[0]) - }} - - ./: pdf{cli-guide}: ps{cli-guide} $ps2pdf - { - options = -dOptimize=true -dEmbedAllFonts=true - - dist = true - clean = ($src_root != $out_root) - } - {{ - diag ps2pdf ($<[0]) - $ps2pdf $options $path($<[0]) $path($>) - }} - } - else - { + html2pdf = ($html2ps != [null] && $ps2pdf != [null]) + + if! $html2pdf warn "html2ps and/or ps2pdf14 are not available, not generating .ps and .pdf documentation" - ./: html2ps{guide} # Note: not keeping ps/pdf (could be outdated). - } } -else - ./: file{cli-prologue* cli-epilogue*} html2ps{guide} {ps pdf}{+cli-guide} + +./: {ps pdf}{cli-guide}: include = $html2pdf + +# In the development build distribute regenerated versions, remapping their +# locations to the paths of the pregenerated versions (which are only +# distributed in the consumption build; see above). This way we make sure that +# the distributed files are always up-to-date. +# +{ps pdf}{cli-guide}: dist = ($html2pdf ? pregenerated/ : false) + +# Note: the pregenerated file may not exist, thus --no-cleanup option is +# required for the cp builtin call. +# +ps{cli-guide}: xhtml{cli-guide} html2ps{guide} $html2ps +{ + options = +} +% +if $html2pdf +{{ + diag html2ps ($<[0]) + $html2ps $options -f $path($<[1]) -o $path($>) $path($<[0]) + + cp --no-cleanup $path($>) $src_base/pregenerated/cli-guide.ps +}} + +pdf{cli-guide}: ps{cli-guide} $ps2pdf +{ + options = -dOptimize=true -dEmbedAllFonts=true +} +% +if $html2pdf +{{ + diag ps2pdf ($<[0]) + $ps2pdf $options $path($<[0]) $path($>) + + cp --no-cleanup $path($>) $src_base/pregenerated/cli-guide.pdf +}} + +# +## diff --git a/cli/doc/pregenerated/cli.1 b/cli/doc/pregenerated/cli.1 new file mode 100644 index 0000000..8cf5cd1 --- /dev/null +++ b/cli/doc/pregenerated/cli.1 @@ -0,0 +1,423 @@ +.\" Process this file with +.\" groff -man -Tascii cli.1 +.\" +.TH CLI 1 "January 2022" "CLI 1.2.0-b.9" +.SH NAME +cli \- command line interface compiler for C++ +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH SYNOPSIS +.\"-------------------------------------------------------------------- +.B cli +.B [ +.I options +.B ] +.I file +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH DESCRIPTION +.\"-------------------------------------------------------------------- +.B cli +generates C++ implementation and documentation in various formats for a +command line interface defined in the CLI language. For an input file in +the form +.B name.cli +the following is generated. By default or if the +.B --generate-cxx +option is specified, the following C++ files are generated: +.B name.hxx +(header file), +.B name.ixx +(inline file, generated unless the +.B --suppress-inline +option is specified), and +.B name.cxx (source file). +If the +.B --generate-html +option is specified, then the +.B name.html +HTML documentation file is generated. If the +.B --generate-man +option is specified, then the +.B name.1 +man page file is generated. When +.B --generate-html +or +.B --generate-man +is specified, the +.B --stdout +option can be used to redirect the output to STDOUT instead of a file. +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH OPTIONS +.\"-------------------------------------------------------------------- +.IP "\fB--help\fR" +Print usage information and exit\. +.IP "\fB--version\fR" +Print version and exit\. +.IP "\fB--include-path\fR|\fB-I\fR \fIdir\fR" +Search \fIdir\fR for bracket-included (\fB<>\fR) options files\. +.IP "\fB--output-dir\fR|\fB-o\fR \fIdir\fR" +Write the generated files to \fIdir\fR instead of the current directory\. +.IP "\fB--std\fR \fIversion\fR" +Specify the C++ standard that should be used during compilation\. Valid values +are \fBc++98\fR (default), \fBc++11\fR, and \fBc++14\fR\. +.IP "\fB--generate-modifier\fR" +Generate option value modifiers in addition to accessors\. +.IP "\fB--generate-specifier\fR" +Generate functions for determining whether the option was specified on the +command line\. +.IP "\fB--generate-parse\fR" +Generate \fBparse()\fR 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 option appending/overriding\. +.IP "\fB--generate-merge\fR" +Generate \fBmerge()\fR functions\. This is primarily useful for being able to +merge several already parsed options class instances, for example, to +implement option appending/overriding\. Note that this option forces +\fB--generate-specifier\fR\. +.IP "\fB--generate-description\fR" +Generate the option description list that can be examined at runtime\. +.IP "\fB--generate-file-scanner\fR" +Generate the \fBargv_file_scanner\fR implementation\. This scanner is capable +of reading command line arguments from the \fBargv\fR array as well as files +specified with command line options\. +.IP "\fB--generate-vector-scanner\fR" +Generate the \fBvector_scanner\fR implementation\. This scanner is capable of +reading command line arguments from \fBvector\fR\. +.IP "\fB--generate-group-scanner\fR" +Generate the \fBgroup_scanner\fR implementation\. This scanner supports +grouping of arguments (usually options) to apply only to a certain argument\. + +Groups can be specified before (leading) and/or after (trailing) the argument +they apply to\. A leading group starts with '\fB{\fR' and ends with '\fB}+\fR' +while a trailing group starts with '\fB+{\fR' and ends with '\fB}\fR'\. For +example: + +.nf +{ --foo --bar }+ arg # 'arg' with '--foo' '--bar' +arg +{ fox=1 baz=2 } # 'arg' with 'fox=1' 'baz=2' +.fi + +Multiple leading and/or trailing groups can be specified for the same +argument\. For example: + +.nf +{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2' +.fi + +The group applies to a single argument only unless multiple arguments are +themselves grouped with '\fB{\fR' and '\fB}\fR'\. For example: + +.nf +{ --foo }+ arg1 arg2 +{ --bar } # 'arg1' with '--foo' + # 'arg2' with '--bar' + +{ --foo }+ { arg1 arg2 } +{ --bar } # 'arg1' with '--foo' '--bar' + # 'arg2' with '--foo' '--bar' +.fi + +The group separators ('\fB{\fR', '\fB}+'\fR, etc) must be separate command +line arguments\. In particular, they must not be adjacent either to the +arguments inside the group nor to the argument they apply to\. All such cases +will be treated as ordinary arguments\. For example: + +.nf +{--foo}+ arg # '{--foo}+' \.\.\. +arg+{ --foo } # 'arg+{' \.\.\. +.fi + +If one of the group separators needs to be specified as an argument verbatim, +then it must be escaped with '\fB\e\fR'\. For example: + +.nf +} # error: unexpected group separator +}x # '}x' +\\} # '}' +{ \\}+ }+ arg # 'arg' with '}+' +.fi +.IP "\fB--suppress-inline\fR" +Generate all functions non-inline\. By default simple functions are made +inline\. This option suppresses creation of the inline file\. +.IP "\fB--suppress-cli\fR" +Do not generate the CLI support types (scanners, parser, etc)\. Normally, the +support types are generated unless another \fB\.cli\fR was included, in which +case the support types are expected to be provided by its generated code\. +.IP "\fB--cli-namespace\fR \fIns\fR" +Generate the CLI support types in the \fIns\fR namespace (\fBcli\fR by +default)\. The namespace can be nested, for example \fBdetails::cli\fR\. If +the namespace is empty, then the support types are generated in the global +namespace\. +.IP "\fB--ostream-type\fR \fItype\fR" +Output stream type instead of the default \fBstd::ostream\fR that should be +used to print usage and exception information\. +.IP "\fB--export-symbol\fR \fIsymbol\fR" +Insert \fIsymbol\fR in places where DLL export/import control statements +(\fB__declspec(dllexport/dllimport)\fR) are necessary\. +.IP "\fB--generate-cxx\fR" +Generate C++ code\. If neither \fB--generate-man\fR, \fB--generate-html\fR, +nor \fB--generate-txt\fR is specified, this mode is assumed by default\. +.IP "\fB--generate-man\fR" +Generate documentation in the man page format\. +.IP "\fB--generate-html\fR" +Generate documentation in the HTML format\. +.IP "\fB--generate-txt\fR" +Generate documentation in the plain text format, similar to usage\. +.IP "\fB--stdout\fR" +Write output to STDOUT instead of a file\. This option is not valid when +generating C++ code and is normally used to combine generated documentation +for several option classes in a single file\. +.IP "\fB--suppress-undocumented\fR" +Suppress the generation of documentation entries for undocumented options\. +.IP "\fB--suppress-usage\fR" +Suppress the generation of the usage printing code\. +.IP "\fB--long-usage\fR" +If no short documentation string is provided, use the complete long +documentation string in usage\. By default, in this situation only the first +sentence from the long string is used\. +.IP "\fB--short-usage\fR" +If specified together with \fB--long-usage\fR, generate both short and long +usage versions\. In this mode, the long usage printing function is called +\fBprint_long_usage()\fR and in its implementation the long documentation +string is always used, even if the short version is provided\. +.IP "\fB--page-usage\fR \fIname\fR" +Generate the combined usage printing code for the entire page\. Specifically, +this will include all the namespace-level documentation as well as usage for +all the options classes printed in the order they are defined in the main +translation unit (documentation/classes from included units are ignored except +for base classes)\. + +The \fIname\fR argument is used as a prefix to form the name of the usage +printing function\. It can include the namespace qualification as well as +documentation variable expansion, for example: + +.nf +--page-usage print_ # print_usage() in global namespace +--page-usage app::print_ # print_usage() in app namespace +--page-usage print_$name$_ # print_foo_usage() if name is foo +.fi + +If both \fB--long-usage\fR and \fB--short-usage\fR options are specified, then +the long usage function has the \fB*long_usage()\fR suffix\. +.IP "\fB--option-length\fR \fIlen\fR" +Indent option descriptions \fIlen\fR characters when printing usage\. This is +useful when you have multiple options classes, potentially in separate files, +and would like their usage to have the same indentation level\. +.IP "\fB--ascii-tree\fR" +Convert UTF-8 \fBtree(1)\fR output to ASCII\. Specifically, box-drawing +characters used in the \fB--charset=UTF-8\fR output are replaced with ASCII +characters used in the \fB--charset=ASCII\fR output\. +.IP "\fB--ansi-color\fR" +Use ANSI color escape sequences when printing usage\. By "color" we really +only mean the bold and underline modifiers\. Note that Windows console does +not recognize ANSI escape sequences and will display them as garbage\. +However, if you pipe such output through \fBless(1)\fR, it will display them +correctly\. +.IP "\fB--exclude-base\fR" +Exclude base class information from usage and documentation\. +.IP "\fB--include-base-last\fR" +Include base class information after derived for usage and documentation\. By +default, base classes are included first\. +.IP "\fB--class-doc\fR \fIname\fR=\fIkind\fR" +Specify the documentation \fIkind\fR that should be used for the options class +\fIname\fR\. The \fIname\fR value should be a fully-qualified class name, for +example, \fBapp::options\fR\. The \fIkind\fR value can be \fBshort\fR, +\fBlong\fR, \fBexclude\fR, or \fBexclude-base\fR\. If the value is +\fBexclude\fR, then the class documentation is excluded from usage and +man/HTML/text output\. If it is \fBexclude-base\fR, then it is only excluded +when used as a base\. For usage, the \fBshort\fR and \fBlong\fR values +determine which usage function will be called when the class is used as base +or as part of the page usage (see \fB--page-usage\fR)\. For man/HTML/text, +these values determine which documentation strings are used in the output\. +.IP "\fB--class\fR \fIname\fR" +Generate the man page, HTML, or text documentation only for the options class +\fIname\fR\. The \fIname\fR value should be a fully-qualified options class +name, for example, \fBapp::options\fR\. To generate documentation for multiple +classes, repeat this option and the documentation will be produced in the +order specified\. This functionality is useful if you need to assemble +documentation from multiple classes in a specific order or to insert custom +documentation between options belonging to different classes\. +.IP "\fB--docvar\fR|\fB-v\fR \fIname\fR=\fIval\fR" +Set documentation variable \fIname\fR to the value \fIval\fR\. Documentation +variables can be substituted in prologues and epilogues (see +\fB--*-prologue*\fR and \fB--*-epilogue*\fR options) using the +\fB$\fR\fIname\fR\fB$\fR expansion syntax (use \fB$$\fR to escape expansion)\. +They can also be defined in \fB\.cli\fR files using the +\&"\e\fIname\fR=\fIval\fR"\fR syntax\. +.IP "\fB--link-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions used to transform link +targets in the generated documentation\. The argument to this option is a +Perl-like regular expression in the form +\fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any character can be +used as a delimiter instead of '\fB/\fR' and the delimiter can be escaped +inside \fIpattern\fR and \fIreplacement\fR with a backslash (\fB\e\fR)\. You +can specify multiple regular expressions by repeating this option\. All the +regular expressions are tried in the order specified and the first expression +that matches is used\. Use the \fB--link-regex-trace\fR option to debug link +transformation\. +.IP "\fB--link-regex-trace\fR" +Trace the process of applying regular expressions specified with the +\fB--link-regex\fR option\. Use this option to find out why your regular +expressions don't do what you expected them to do\. +.IP "\fB--html-heading-map\fR \fIc\fR=\fIh\fR" +Map CLI heading \fIc\fR (valid values: '\fBH\fR', '\fB0\fR', '\fB1\fR', +\&'\fBh\fR', and '\fB2\fR') to HTML heading \fIh\fR (for example, '\fBh1\fR', +\&'\fBh2\fR', etc)\. +.IP "\fB--omit-link-check\fR" +Don't check that local fragment link references (\el{#ref \.\.\.}) resolve to +ids\. +.IP "\fB--hxx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ header file\. +.IP "\fB--ixx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ inline file\. +.IP "\fB--cxx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ source file\. +.IP "\fB--man-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated man page file\. +.IP "\fB--html-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated HTML file\. +.IP "\fB--txt-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated text file\. +.IP "\fB--hxx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ header file\. +.IP "\fB--ixx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ inline file\. +.IP "\fB--cxx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ source file\. +.IP "\fB--man-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated man page file\. +.IP "\fB--html-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated HTML file\. +.IP "\fB--txt-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated text file\. +.IP "\fB--hxx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ header +file\. +.IP "\fB--ixx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ inline +file\. +.IP "\fB--cxx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ source +file\. +.IP "\fB--man-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated man page +file\. +.IP "\fB--html-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated HTML file\. +.IP "\fB--txt-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated text file\. +.IP "\fB--hxx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ header file\. +.IP "\fB--ixx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ inline file\. +.IP "\fB--cxx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ source file\. +.IP "\fB--man-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated man page file\. +.IP "\fB--html-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated HTML file\. +.IP "\fB--txt-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated text file\. +.IP "\fB--output-prefix\fR \fIprefix\fR" +Add \fIprefix\fR at the beginning of the generated output file name(s)\. +.IP "\fB--output-suffix\fR \fIsuffix\fR" +Add \fIsuffix\fR at the end of the generated output file name(s)\. Note that +it is added before any file type-specific suffixes; see \fB--*-suffix\fR +below\. +.IP "\fB--hxx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.hxx\fR to construct the name of +the generated header file\. +.IP "\fB--ixx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.ixx\fR to construct the name of +the generated inline file\. +.IP "\fB--cxx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.cxx\fR to construct the name of +the generated source file\. +.IP "\fB--man-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.1\fR to construct the name of the +generated man page file\. +.IP "\fB--html-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.html\fR to construct the name of +the generated HTML file\. +.IP "\fB--txt-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.txt\fR to construct the name of +the generated text file\. +.IP "\fB--option-prefix\fR \fIprefix\fR" +Use \fIprefix\fR instead of the default '\fB-\fR' as an option prefix\. +Unknown command line arguments that start with this prefix are treated as +unknown options\. If you set the option prefix to the empty value, then all +the unknown command line arguments will be treated as program arguments\. +.IP "\fB--option-separator\fR \fIsep\fR" +Use \fIsep\fR instead of the default '\fB--\fR' as an optional separator +between options and arguments\. All the command line arguments that are parsed +after this separator are treated as program arguments\. Set the option +separator to the empty value if you don't want this functionality\. +.IP "\fB--keep-separator\fR" +Leave the option separator in the scanner\. This is primarily useful for +incremental option parsing\. +.IP "\fB--no-combined-flags\fR" +Disable support for combining multiple single-character flags into a single +argument (the \fB-xyz\fR form that is equivalent to \fB-x\fR \fB-y\fR +\fB-z\fR)\. An argument is considered a combination of flags if it starts with +a single option prefix (\fB--option-prefix\fR) and only contains letters and +digits\. Note that an option with a value may not be part of such a +combination, not even if it is specified last\. +.IP "\fB--no-combined-values\fR" +Disable support for combining an option and its value into a single argument +with the assignment sign (the \fIoption\fR\fB=\fR\fIvalue\fR\fR form)\. This +functionality requires a non-empty option prefix (\fB--option-prefix\fR)\. +.IP "\fB--include-with-brackets\fR" +Use angle brackets (\fB<>\fR) instead of quotes (\fB""\fR) in the generated +\fB#include\fR directives\. +.IP "\fB--include-prefix\fR \fIprefix\fR" +Add \fIprefix\fR to the generated \fB#include\fR directive paths\. +.IP "\fB--guard-prefix\fR \fIprefix\fR" +Add \fIprefix\fR to the generated header inclusion guards\. The prefix is +transformed to upper case and characters that are illegal in a preprocessor +macro name are replaced with underscores\. +.IP "\fB--reserved-name\fR \fIname\fR=\fIrep\fR" +Add \fIname\fR with an optional \fIrep\fR replacement to the list of names +that should not be used as identifiers\. If provided, the replacement name is +used instead\. All C++ keywords are already in this list\. +.IP "\fB--options-file\fR \fIfile\fR" +Read additional options from \fIfile\fR\. Each option should appear on a +separate line optionally followed by space or equal sign (\fB=\fR) and an +option value\. Empty lines and lines starting with \fB#\fR are ignored\. +Option values can be enclosed in double (\fB"\fR) or single (\fB'\fR) quotes +to preserve leading and trailing whitespaces as well as to specify empty +values\. If the value itself contains trailing or leading quotes, enclose it +with an extra pair of quotes, for example \fB'"x"'\fR\. Non-leading and +non-trailing quotes are interpreted as being part of the option value\. + +The semantics of providing options in a file is equivalent to providing the +same set of options in the same order on the command line at the point where +the \fB--options-file\fR option is specified except that the shell escaping +and quoting is not required\. Repeat this option to specify more than one +options file\. +.\" +.\" DIAGNOSTICS +.\" +.SH DIAGNOSTICS +If the input file is not a valid CLI definition, +.B cli +will issue diagnostic messages to STDERR and exit with non-zero exit code. +.\" +.\" BUGS +.\" +.SH BUGS +Send bug reports to the cli-users@codesynthesis.com mailing list. +.\" +.\" COPYRIGHT +.\" +.SH COPYRIGHT +Copyright (c) 2009-2022 Code Synthesis Tools CC. + +Permission is granted to copy, distribute and/or modify this document under +the terms of the MIT License. Copy of this license can be obtained from +http://www.codesynthesis.com/licenses/mit.txt diff --git a/cli/doc/pregenerated/cli.xhtml b/cli/doc/pregenerated/cli.xhtml new file mode 100644 index 0000000..909fa34 --- /dev/null +++ b/cli/doc/pregenerated/cli.xhtml @@ -0,0 +1,584 @@ + + + + + CLI 1.2.0-b.9 Compiler Command Line Manual + + + + + + + + + + + +
+
+ +

NAME

+ +

cli - command line interface compiler for C++

+ +

SYNOPSIS

+ +
+
cli [options] file
+
+ +

DESCRIPTION

+ +

cli generates C++ implementation and + documentation in various formats for a command line interface + defined in the CLI language. For an input file in the form + name.cli the following is generated. By + default or if the --generate-cxx option is + specified, the following C++ files are generated: + name.hxx (header file), name.ixx + (inline file, generated unless the --suppress-inline + option is specified), and name.cxx (source file). + If the --generate-html option is specified, then + the name.html HTML documentation file is generated. + If the --generate-man option is specified, then + the name.1 man page file is generated. When + --generate-html or --generate-man + is specified, the --stdout option can be used to + redirect the output to STDOUT instead of a file.

+ +

OPTIONS

+
+
--help
+
Print usage information and exit.
+ +
--version
+
Print version and exit.
+ +
--include-path|-I dir
+
Search dir for bracket-included + (<>) options files.
+ +
--output-dir|-o dir
+
Write the generated files to dir instead of the + current directory.
+ +
--std version
+
Specify the C++ standard that should be used during compilation. Valid + values are c++98 (default), c++11, + and c++14.
+ +
--generate-modifier
+
Generate option value modifiers in addition to accessors.
+ +
--generate-specifier
+
Generate functions for determining whether the option was specified on + the command line.
+ +
--generate-parse
+
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 + option appending/overriding.
+ +
--generate-merge
+
Generate merge() functions. This is primarily + useful for being able to merge several already parsed options class + instances, for example, to implement option appending/overriding. Note + that this option forces --generate-specifier.
+ +
--generate-description
+
Generate the option description list that can be examined at + runtime.
+ +
--generate-file-scanner
+
Generate the argv_file_scanner implementation. + This scanner is capable of reading command line arguments from the + argv array as well as files specified with command + line options.
+ +
--generate-vector-scanner
+
Generate the vector_scanner implementation. This + scanner is capable of reading command line arguments from + vector<string>.
+ +
--generate-group-scanner
+
Generate the group_scanner implementation. This + scanner supports grouping of arguments (usually options) to apply only to + a certain argument. + +

Groups can be specified before (leading) and/or after (trailing) the + argument they apply to. A leading group starts with + '{' and ends with '}+' while a + trailing group starts with '+{' and ends with + '}'. For example:

+ +
{ --foo --bar }+ arg   # 'arg' with '--foo' '--bar'
+arg +{ fox=1 baz=2 }   # 'arg' with 'fox=1' 'baz=2'
+ +

Multiple leading and/or trailing groups can be specified for the same + argument. For example:

+ +
{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2'
+ +

The group applies to a single argument only unless multiple arguments + are themselves grouped with '{' and + '}'. For example:

+ +
{ --foo }+ arg1  arg2 +{ --bar }      # 'arg1' with '--foo'
+                                      # 'arg2' with '--bar'
+
+{ --foo }+ { arg1  arg2 } +{ --bar }  # 'arg1' with '--foo' '--bar'
+                                      # 'arg2' with '--foo' '--bar'
+ +

The group separators ('{', + '}+', etc) must be separate command line arguments. In + particular, they must not be adjacent either to the arguments inside the + group nor to the argument they apply to. All such cases will be treated as + ordinary arguments. For example:

+ +
{--foo}+ arg   # '{--foo}+' ...
+arg+{ --foo }  # 'arg+{' ...
+ +

If one of the group separators needs to be specified as an argument + verbatim, then it must be escaped with '\'. For + example:

+ +
}             # error: unexpected group separator
+}x            # '}x'
+\}            # '}'
+{ \}+ }+ arg  # 'arg' with '}+'
+ +
--suppress-inline
+
Generate all functions non-inline. By default simple functions are + made inline. This option suppresses creation of the inline file.
+ +
--suppress-cli
+
Do not generate the CLI support types (scanners, parser, etc). + Normally, the support types are generated unless another + .cli was included, in which case the support types are + expected to be provided by its generated code.
+ +
--cli-namespace ns
+
Generate the CLI support types in the ns namespace + (cli by default). The namespace can be nested, for + example details::cli. If the namespace is empty, then + the support types are generated in the global namespace.
+ +
--ostream-type type
+
Output stream type instead of the default + std::ostream that should be used to print usage and + exception information.
+ +
--export-symbol symbol
+
Insert symbol in places where DLL export/import + control statements (__declspec(dllexport/dllimport)) + are necessary.
+ +
--generate-cxx
+
Generate C++ code. If neither --generate-man, + --generate-html, nor + --generate-txt is specified, this mode is assumed by + default.
+ +
--generate-man
+
Generate documentation in the man page format.
+ +
--generate-html
+
Generate documentation in the HTML format.
+ +
--generate-txt
+
Generate documentation in the plain text format, similar to + usage.
+ +
--stdout
+
Write output to STDOUT instead of a file. This option is not valid + when generating C++ code and is normally used to combine generated + documentation for several option classes in a single file.
+ +
--suppress-undocumented
+
Suppress the generation of documentation entries for undocumented + options.
+ +
--suppress-usage
+
Suppress the generation of the usage printing code.
+ +
--long-usage
+
If no short documentation string is provided, use the complete long + documentation string in usage. By default, in this situation only the + first sentence from the long string is used.
+ +
--short-usage
+
If specified together with --long-usage, generate + both short and long usage versions. In this mode, the long usage printing + function is called print_long_usage() and in its + implementation the long documentation string is always used, even if the + short version is provided.
+ +
--page-usage name
+
Generate the combined usage printing code for the entire page. + Specifically, this will include all the namespace-level documentation as + well as usage for all the options classes printed in the order they are + defined in the main translation unit (documentation/classes from included + units are ignored except for base classes). + +

The name argument is used as a prefix to form the + name of the usage printing function. It can include the namespace + qualification as well as documentation variable expansion, for + example:

+ +
--page-usage print_         # print_usage() in global namespace
+--page-usage app::print_    # print_usage() in app namespace
+--page-usage print_$name$_  # print_foo_usage() if name is foo
+ +

If both --long-usage and + --short-usage options are specified, then the long + usage function has the *long_usage() suffix.

+ +
--option-length len
+
Indent option descriptions len characters when + printing usage. This is useful when you have multiple options classes, + potentially in separate files, and would like their usage to have the same + indentation level.
+ +
--ascii-tree
+
Convert UTF-8 tree(1) output to ASCII. + Specifically, box-drawing characters used in the + --charset=UTF-8 output are replaced with ASCII + characters used in the --charset=ASCII output.
+ +
--ansi-color
+
Use ANSI color escape sequences when printing usage. By "color" we + really only mean the bold and underline modifiers. Note that Windows + console does not recognize ANSI escape sequences and will display them as + garbage. However, if you pipe such output through + less(1), it will display them correctly.
+ +
--exclude-base
+
Exclude base class information from usage and documentation.
+ +
--include-base-last
+
Include base class information after derived for usage and + documentation. By default, base classes are included first.
+ +
--class-doc name=kind
+
Specify the documentation kind that should be used + for the options class name. The + name value should be a fully-qualified class name, for + example, app::options. The kind + value can be short, long, + exclude, or exclude-base. If the + value is exclude, then the class documentation is + excluded from usage and man/HTML/text output. If it is + exclude-base, then it is only excluded when used as a + base. For usage, the short and + long values determine which usage function will be + called when the class is used as base or as part of the page usage (see + --page-usage). For man/HTML/text, these values + determine which documentation strings are used in the output.
+ +
--class name
+
Generate the man page, HTML, or text documentation only for the + options class name. The name value + should be a fully-qualified options class name, for example, + app::options. To generate documentation for multiple + classes, repeat this option and the documentation will be produced in the + order specified. This functionality is useful if you need to assemble + documentation from multiple classes in a specific order or to insert + custom documentation between options belonging to different classes.
+ +
--docvar|-v name=val
+
Set documentation variable name to the value + val. Documentation variables can be substituted in + prologues and epilogues (see --*-prologue* and + --*-epilogue* options) using the + $name$ + expansion syntax (use $$ to escape expansion). They + can also be defined in .cli files using the + "\name=val" + syntax.
+ +
--link-regex regex
+
Add regex to the list of regular expressions used + to transform link targets in the generated documentation. The argument to + this option is a Perl-like regular expression in the form + /pattern/replacement/. Any + character can be used as a delimiter instead of '/' + and the delimiter can be escaped inside pattern and + replacement with a backslash (\). + You can specify multiple regular expressions by repeating this option. All + the regular expressions are tried in the order specified and the first + expression that matches is used. Use the + --link-regex-trace option to debug link + transformation.
+ +
--link-regex-trace
+
Trace the process of applying regular expressions specified with the + --link-regex option. Use this option to find out why + your regular expressions don't do what you expected them to do.
+ +
--html-heading-map c=h
+
Map CLI heading c (valid values: + 'H', '0', '1', + 'h', and '2') to HTML heading + h (for example, 'h1', + 'h2', etc).
+ +
--omit-link-check
+
Don't check that local fragment link references (\l{#ref ...}) resolve + to ids.
+ +
--hxx-prologue text
+
Insert text at the beginning of the generated C++ + header file.
+ +
--ixx-prologue text
+
Insert text at the beginning of the generated C++ + inline file.
+ +
--cxx-prologue text
+
Insert text at the beginning of the generated C++ + source file.
+ +
--man-prologue text
+
Insert text at the beginning of the generated man + page file.
+ +
--html-prologue text
+
Insert text at the beginning of the generated HTML + file.
+ +
--txt-prologue text
+
Insert text at the beginning of the generated text + file.
+ +
--hxx-epilogue text
+
Insert text at the end of the generated C++ header + file.
+ +
--ixx-epilogue text
+
Insert text at the end of the generated C++ inline + file.
+ +
--cxx-epilogue text
+
Insert text at the end of the generated C++ source + file.
+ +
--man-epilogue text
+
Insert text at the end of the generated man page + file.
+ +
--html-epilogue text
+
Insert text at the end of the generated HTML + file.
+ +
--txt-epilogue text
+
Insert text at the end of the generated text + file.
+ +
--hxx-prologue-file file
+
Insert the content of file at the beginning of the + generated C++ header file.
+ +
--ixx-prologue-file file
+
Insert the content of file at the beginning of the + generated C++ inline file.
+ +
--cxx-prologue-file file
+
Insert the content of file at the beginning of the + generated C++ source file.
+ +
--man-prologue-file file
+
Insert the content of file at the beginning of the + generated man page file.
+ +
--html-prologue-file file
+
Insert the content of file at the beginning of the + generated HTML file.
+ +
--txt-prologue-file file
+
Insert the content of file at the beginning of the + generated text file.
+ +
--hxx-epilogue-file file
+
Insert the content of file at the end of the + generated C++ header file.
+ +
--ixx-epilogue-file file
+
Insert the content of file at the end of the + generated C++ inline file.
+ +
--cxx-epilogue-file file
+
Insert the content of file at the end of the + generated C++ source file.
+ +
--man-epilogue-file file
+
Insert the content of file at the end of the + generated man page file.
+ +
--html-epilogue-file file
+
Insert the content of file at the end of the + generated HTML file.
+ +
--txt-epilogue-file file
+
Insert the content of file at the end of the + generated text file.
+ +
--output-prefix prefix
+
Add prefix at the beginning of the generated + output file name(s).
+ +
--output-suffix suffix
+
Add suffix at the end of the generated output file + name(s). Note that it is added before any file type-specific suffixes; see + --*-suffix below.
+ +
--hxx-suffix suffix
+
Use suffix instead of the default + .hxx to construct the name of the generated header + file.
+ +
--ixx-suffix suffix
+
Use suffix instead of the default + .ixx to construct the name of the generated inline + file.
+ +
--cxx-suffix suffix
+
Use suffix instead of the default + .cxx to construct the name of the generated source + file.
+ +
--man-suffix suffix
+
Use suffix instead of the default + .1 to construct the name of the generated man page + file.
+ +
--html-suffix suffix
+
Use suffix instead of the default + .html to construct the name of the generated HTML + file.
+ +
--txt-suffix suffix
+
Use suffix instead of the default + .txt to construct the name of the generated text + file.
+ +
--option-prefix prefix
+
Use prefix instead of the default + '-' as an option prefix. Unknown command line + arguments that start with this prefix are treated as unknown options. If + you set the option prefix to the empty value, then all the unknown command + line arguments will be treated as program arguments.
+ +
--option-separator sep
+
Use sep instead of the default + '--' as an optional separator between options and + arguments. All the command line arguments that are parsed after this + separator are treated as program arguments. Set the option separator to + the empty value if you don't want this functionality.
+ +
--keep-separator
+
Leave the option separator in the scanner. This is primarily useful + for incremental option parsing.
+ +
--no-combined-flags
+
Disable support for combining multiple single-character flags into a + single argument (the -xyz form that is equivalent to + -x -y -z). An + argument is considered a combination of flags if it starts with a single + option prefix (--option-prefix) and only contains + letters and digits. Note that an option with a value may not be part of + such a combination, not even if it is specified last.
+ +
--no-combined-values
+
Disable support for combining an option and its value into a single + argument with the assignment sign (the + option=value form). This functionality + requires a non-empty option prefix + (--option-prefix).
+ +
--include-with-brackets
+
Use angle brackets (<>) instead of quotes + ("") in the generated #include + directives.
+ +
--include-prefix prefix
+
Add prefix to the generated + #include directive paths.
+ +
--guard-prefix prefix
+
Add prefix to the generated header inclusion + guards. The prefix is transformed to upper case and characters that are + illegal in a preprocessor macro name are replaced with underscores.
+ +
--reserved-name name=rep
+
Add name with an optional rep + replacement to the list of names that should not be used as identifiers. + If provided, the replacement name is used instead. All C++ keywords are + already in this list.
+ +
--options-file file
+
Read additional options from file. Each option + should appear on a separate line optionally followed by space or equal + sign (=) and an option value. Empty lines and lines + starting with # are ignored. Option values can be + enclosed in double (") or single + (') quotes to preserve leading and trailing + whitespaces as well as to specify empty values. If the value itself + contains trailing or leading quotes, enclose it with an extra pair of + quotes, for example '"x"'. Non-leading and + non-trailing quotes are interpreted as being part of the option value. + +

The semantics of providing options in a file is equivalent to providing + the same set of options in the same order on the command line at the point + where the --options-file option is specified except + that the shell escaping and quoting is not required. Repeat this option to + specify more than one options file.

+
+ +

DIAGNOSTICS

+ +

If the input file is not a valid CLI definition, cli + will issue diagnostic messages to STDERR and exit with non-zero exit + code.

+ +

BUGS

+ +

Send bug reports to the + cli-users@codesynthesis.com mailing list.

+ +
+ +
+ + -- cgit v1.1