From a51a5f81cabeb15fe8bf7fa6d02e287763758a69 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 21 May 2024 11:08:50 +0300 Subject: Make changes required for CI --- load/load-options.cxx | 1216 +++++++++++++++++++++++++++++++++++++++++++++++++ load/load-options.hxx | 719 +++++++++++++++++++++++++++++ load/load-options.ixx | 809 ++++++++++++++++++++++++++++++++ 3 files changed, 2744 insertions(+) create mode 100644 load/load-options.cxx create mode 100644 load/load-options.hxx create mode 100644 load/load-options.ixx (limited to 'load') diff --git a/load/load-options.cxx b/load/load-options.cxx new file mode 100644 index 0000000..99a6f77 --- /dev/null +++ b/load/load-options.cxx @@ -0,0 +1,1216 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +#include +// +// End prologue. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cli +{ + // unknown_option + // + unknown_option:: + ~unknown_option () noexcept + { + } + + void unknown_option:: + print (::std::ostream& os) const + { + os << "unknown option '" << option ().c_str () << "'"; + } + + const char* unknown_option:: + what () const noexcept + { + return "unknown option"; + } + + // unknown_argument + // + unknown_argument:: + ~unknown_argument () noexcept + { + } + + void unknown_argument:: + print (::std::ostream& os) const + { + os << "unknown argument '" << argument ().c_str () << "'"; + } + + const char* unknown_argument:: + what () const noexcept + { + return "unknown argument"; + } + + // missing_value + // + missing_value:: + ~missing_value () noexcept + { + } + + void missing_value:: + print (::std::ostream& os) const + { + os << "missing value for option '" << option ().c_str () << "'"; + } + + const char* missing_value:: + what () const noexcept + { + return "missing option value"; + } + + // invalid_value + // + invalid_value:: + ~invalid_value () noexcept + { + } + + 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 noexcept + { + return "invalid option value"; + } + + // eos_reached + // + void eos_reached:: + print (::std::ostream& os) const + { + os << what (); + } + + const char* eos_reached:: + what () const noexcept + { + return "end of argument stream reached"; + } + + // 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_; + } + + 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 + struct parser > + { + static void + parse (std::multimap& 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.insert (typename std::multimap::value_type (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 () +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ +} + +options:: +options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ + ::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) +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ + ::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) +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ + ::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) +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ + ::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) +: ignore_unknown_ (), + force_ (), + shallow_ (), + ignore_unresolved_tests_ (), + tenant_ (), + tenant_specified_ (false), + tenant_load_ (), + private__ (), + interactive_ (), + interactive_specified_ (false), + service_id_ (), + service_id_specified_ (false), + service_type_ (), + service_type_specified_ (false), + service_data_ (), + service_data_specified_ (false), + overrides_file_ (), + overrides_file_specified_ (false), + db_user_ (), + db_user_specified_ (false), + db_password_ (), + db_password_specified_ (false), + db_name_ ("brep_package"), + db_name_specified_ (false), + db_host_ (), + db_host_specified_ (false), + db_port_ (0), + db_port_specified_ (false), + bpkg_ ("bpkg"), + bpkg_specified_ (false), + bpkg_option_ (), + bpkg_option_specified_ (false), + openssl_ ("openssl"), + openssl_specified_ (false), + openssl_option_ (), + openssl_option_specified_ (false), + pager_ (), + pager_specified_ (false), + pager_option_ (), + pager_option_specified_ (false), + help_ (), + version_ () +{ + _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::none) + os << ::std::endl; + + os << "\033[1mOPTIONS\033[0m" << ::std::endl; + + os << std::endl + << "\033[1m--ignore-unknown\033[0m Ignore unknown manifest entries." << ::std::endl; + + os << std::endl + << "\033[1m--force\033[0m Reload package information regardless of the" << ::std::endl + << " repository manifest file timestamps." << ::std::endl; + + os << std::endl + << "\033[1m--shallow\033[0m Don't load package information from prerequisite or" << ::std::endl + << " complement repositories, don't fail if unable to" << ::std::endl + << " resolve a package dependency, and don't detect" << ::std::endl + << " package dependency cycles." << ::std::endl; + + os << std::endl + << "\033[1m--ignore-unresolved-tests\033[0m Ignore tests, examples, and benchmarks package" << ::std::endl + << " manifest entries which cannot be resolved from the" << ::std::endl + << " main package's complement repositories, recursively." << ::std::endl + << " Note that in contrast to --shallow option, such" << ::std::endl + << " entries will be removed from the main package" << ::std::endl + << " manifests outright." << ::std::endl; + + os << std::endl + << "\033[1m--tenant\033[0m \033[4mid\033[0m Tenant the package and repository information should" << ::std::endl + << " be loaded in. If not specified, then the" << ::std::endl + << " single-tenant mode is assumed." << ::std::endl; + + os << std::endl + << "\033[1m--tenant-load\033[0m Load the repository and package information into the" << ::std::endl + << " pre-created empty tenant rather than into the newly" << ::std::endl + << " created one. Requires the \033[1m--tenant\033[0m option to be" << ::std::endl + << " specified." << ::std::endl; + + os << std::endl + << "\033[1m--private\033[0m Display the tenant packages in the web interface only" << ::std::endl + << " in the tenant view mode." << ::std::endl; + + os << std::endl + << "\033[1m--interactive\033[0m \033[4mbkp\033[0m Build the tenant packages interactively, stopping" << ::std::endl + << " builds at the specified breakpoint. Implies" << ::std::endl + << " \033[1m--private\033[0m." << ::std::endl; + + os << std::endl + << "\033[1m--service-id\033[0m \033[4mid\033[0m Third party service information to associate with the" << ::std::endl + << " being created tenant. Requires the \033[1m--tenant\033[0m and" << ::std::endl + << " \033[1m--service-type\033[0m options to be specified." << ::std::endl; + + os << std::endl + << "\033[1m--service-type\033[0m \033[4mtype\033[0m Type of the service to associate with the being" << ::std::endl + << " created tenant. Requires the \033[1m--service-id\033[0m option to" << ::std::endl + << " be specified." << ::std::endl; + + os << std::endl + << "\033[1m--service-data\033[0m \033[4mdata\033[0m Service data to associate with the being created" << ::std::endl + << " tenant. Requires the \033[1m--service-id\033[0m option to be" << ::std::endl + << " specified." << ::std::endl; + + os << std::endl + << "\033[1m--overrides-file\033[0m \033[4mfile\033[0m Read package manifest overrides from the specified" << ::std::endl + << " manifest fragment file and apply them to packages" << ::std::endl + << " being loaded." << ::std::endl; + + os << std::endl + << "\033[1m--db-user\033[0m|\033[1m-u\033[0m \033[4muser\033[0m Database user name. If not specified, then operating" << ::std::endl + << " system (login) name is used." << ::std::endl; + + os << std::endl + << "\033[1m--db-password\033[0m \033[4mpass\033[0m Database password. If not specified, then login" << ::std::endl + << " without password is expected to work." << ::std::endl; + + os << std::endl + << "\033[1m--db-name\033[0m|\033[1m-n\033[0m \033[4mname\033[0m Database name. If not specified, then \033[1mbrep_package\033[0m is" << ::std::endl + << " used by default." << ::std::endl; + + os << std::endl + << "\033[1m--db-host\033[0m|\033[1m-h\033[0m \033[4mhost\033[0m Database host name, address, or socket. If not" << ::std::endl + << " specified, then connect to \033[1mlocalhost\033[0m using the" << ::std::endl + << " operating system-default mechanism (Unix-domain" << ::std::endl + << " socket, etc)." << ::std::endl; + + os << std::endl + << "\033[1m--db-port\033[0m|\033[1m-p\033[0m \033[4mport\033[0m Database port number. If not specified, the default" << ::std::endl + << " port is used." << ::std::endl; + + os << std::endl + << "\033[1m--bpkg\033[0m \033[4mpath\033[0m The package manager program to be used to fetch" << ::std::endl + << " repository information. This should be the path to" << ::std::endl + << " the \033[1mbpkg\033[0m executable. You can also specify additional" << ::std::endl + << " options that should be passed to the package manager" << ::std::endl + << " program with \033[1m--bpkg-option\033[0m. If the package manager" << ::std::endl + << " program is not explicitly specified, then \033[1mbrep-load\033[0m" << ::std::endl + << " will use \033[1mbpkg\033[0m by default." << ::std::endl; + + os << std::endl + << "\033[1m--bpkg-option\033[0m \033[4mopt\033[0m Additional option to be passed to the package manager" << ::std::endl + << " program. See \033[1m--bpkg\033[0m for more information on the" << ::std::endl + << " package manager program. Repeat this option to" << ::std::endl + << " specify multiple package manager options." << ::std::endl; + + os << std::endl + << "\033[1mopenssl\033[0m \033[4mpath\033[0m The openssl program to be used for crypto operations." << ::std::endl + << " You can also specify additional options that should" << ::std::endl + << " be passed to the openssl program with \033[1mopenssl-option\033[0m." << ::std::endl + << " If the openssl program is not explicitly specified," << ::std::endl + << " then \033[1mbrep-load\033[0m will use \033[1mopenssl\033[0m by default." << ::std::endl; + + os << std::endl + << "\033[1mopenssl-option\033[0m \033[4mopt\033[0m Additional option to be passed to the openssl program" << ::std::endl + << " (see \033[1mopenssl\033[0m for details). Repeat this option to" << ::std::endl + << " specify multiple openssl options." << ::std::endl; + + os << std::endl + << "\033[1m--pager\033[0m \033[4mpath\033[0m The pager program to be used to show long text." << ::std::endl + << " Commonly used pager programs are \033[1mless\033[0m and \033[1mmore\033[0m. You" << ::std::endl + << " can also specify additional options that should be" << ::std::endl + << " passed to the pager program with \033[1m--pager-option\033[0m. If" << ::std::endl + << " an empty string is specified as the pager program," << ::std::endl + << " then no pager will be used. If the pager program is" << ::std::endl + << " not explicitly specified, then \033[1mbrep-load\033[0m will try to" << ::std::endl + << " use \033[1mless\033[0m. If it is not available, then no pager will" << ::std::endl + << " be used." << ::std::endl; + + os << std::endl + << "\033[1m--pager-option\033[0m \033[4mopt\033[0m Additional option to be passed to the pager program." << ::std::endl + << " See \033[1m--pager\033[0m for more information on the pager" << ::std::endl + << " program. Repeat this option to specify multiple pager" << ::std::endl + << " options." << ::std::endl; + + os << std::endl + << "\033[1m--help\033[0m Print usage information and exit." << ::std::endl; + + os << std::endl + << "\033[1m--version\033[0m Print version and exit." << ::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_["--ignore-unknown"] = + &::cli::thunk< options, &options::ignore_unknown_ >; + _cli_options_map_["--force"] = + &::cli::thunk< options, &options::force_ >; + _cli_options_map_["--shallow"] = + &::cli::thunk< options, &options::shallow_ >; + _cli_options_map_["--ignore-unresolved-tests"] = + &::cli::thunk< options, &options::ignore_unresolved_tests_ >; + _cli_options_map_["--tenant"] = + &::cli::thunk< options, std::string, &options::tenant_, + &options::tenant_specified_ >; + _cli_options_map_["--tenant-load"] = + &::cli::thunk< options, &options::tenant_load_ >; + _cli_options_map_["--private"] = + &::cli::thunk< options, &options::private__ >; + _cli_options_map_["--interactive"] = + &::cli::thunk< options, std::string, &options::interactive_, + &options::interactive_specified_ >; + _cli_options_map_["--service-id"] = + &::cli::thunk< options, std::string, &options::service_id_, + &options::service_id_specified_ >; + _cli_options_map_["--service-type"] = + &::cli::thunk< options, std::string, &options::service_type_, + &options::service_type_specified_ >; + _cli_options_map_["--service-data"] = + &::cli::thunk< options, std::string, &options::service_data_, + &options::service_data_specified_ >; + _cli_options_map_["--overrides-file"] = + &::cli::thunk< options, brep::path, &options::overrides_file_, + &options::overrides_file_specified_ >; + _cli_options_map_["--db-user"] = + &::cli::thunk< options, std::string, &options::db_user_, + &options::db_user_specified_ >; + _cli_options_map_["-u"] = + &::cli::thunk< options, std::string, &options::db_user_, + &options::db_user_specified_ >; + _cli_options_map_["--db-password"] = + &::cli::thunk< options, std::string, &options::db_password_, + &options::db_password_specified_ >; + _cli_options_map_["--db-name"] = + &::cli::thunk< options, std::string, &options::db_name_, + &options::db_name_specified_ >; + _cli_options_map_["-n"] = + &::cli::thunk< options, std::string, &options::db_name_, + &options::db_name_specified_ >; + _cli_options_map_["--db-host"] = + &::cli::thunk< options, std::string, &options::db_host_, + &options::db_host_specified_ >; + _cli_options_map_["-h"] = + &::cli::thunk< options, std::string, &options::db_host_, + &options::db_host_specified_ >; + _cli_options_map_["--db-port"] = + &::cli::thunk< options, std::uint16_t, &options::db_port_, + &options::db_port_specified_ >; + _cli_options_map_["-p"] = + &::cli::thunk< options, std::uint16_t, &options::db_port_, + &options::db_port_specified_ >; + _cli_options_map_["--bpkg"] = + &::cli::thunk< options, brep::path, &options::bpkg_, + &options::bpkg_specified_ >; + _cli_options_map_["--bpkg-option"] = + &::cli::thunk< options, brep::strings, &options::bpkg_option_, + &options::bpkg_option_specified_ >; + _cli_options_map_["openssl"] = + &::cli::thunk< options, brep::path, &options::openssl_, + &options::openssl_specified_ >; + _cli_options_map_["openssl-option"] = + &::cli::thunk< options, brep::strings, &options::openssl_option_, + &options::openssl_option_specified_ >; + _cli_options_map_["--pager"] = + &::cli::thunk< options, std::string, &options::pager_, + &options::pager_specified_ >; + _cli_options_map_["--pager-option"] = + &::cli::thunk< options, std::vector, &options::pager_option_, + &options::pager_option_specified_ >; + _cli_options_map_["--help"] = + &::cli::thunk< options, &options::help_ >; + _cli_options_map_["--version"] = + &::cli::thunk< options, &options::version_ >; + } +}; + +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; +} + +::cli::usage_para +print_usage (::std::ostream& os, ::cli::usage_para p) +{ + CLI_POTENTIALLY_UNUSED (os); + + if (p != ::cli::usage_para::none) + os << ::std::endl; + + os << "\033[1mSYNOPSIS\033[0m" << ::std::endl + << ::std::endl + << "\033[1mbrep-load --help\033[0m" << ::std::endl + << "\033[1mbrep-load --version\033[0m" << ::std::endl + << "\033[1mbrep-load\033[0m [\033[4moptions\033[0m] \033[4mloadtab\033[0m\033[0m" << ::std::endl + << ::std::endl + << "\033[1mDESCRIPTION\033[0m" << ::std::endl + << ::std::endl + << "\033[1mbrep-load\033[0m reads the list of repositories from the specified \033[4mloadtab\033[0m" << ::std::endl + << "configuration file, fetches their manifest files, and loads the repository and" << ::std::endl + << "package information into the \033[1mpackage\033[0m database, suitable for consumption by the" << ::std::endl + << "\033[1mbrep\033[0m web module." << ::std::endl + << ::std::endl + << "Note that \033[1mbrep-load\033[0m expects the \033[1mpackage\033[0m database schema to have already been" << ::std::endl + << "created using \033[1mbrep-migrate(1)\033[0m." << ::std::endl + << ::std::endl + << "Also note that \033[1mbrep-load\033[0m requires \033[1mbpkg(1)\033[0m to fetch repository information. See" << ::std::endl + << "\033[1m--bpkg\033[0m for more information on the package manager program." << ::std::endl; + + p = ::options::print_usage (os, ::cli::usage_para::text); + + if (p != ::cli::usage_para::none) + os << ::std::endl; + + os << "\033[1mEXIT STATUS\033[0m" << ::std::endl + << ::std::endl + << "\033[1m0\033[0m" << ::std::endl + << " Success." << ::std::endl + << "\033[1m1\033[0m" << ::std::endl + << " Fatal error." << ::std::endl + << "\033[1m2\033[0m" << ::std::endl + << " An instance of \033[1mbrep-load\033[0m or some other \033[1mbrep\033[0m utility is already running. Try" << ::std::endl + << " again." << ::std::endl + << "\033[1m3\033[0m" << ::std::endl + << " Recoverable database error. Try again." << ::std::endl; + + p = ::cli::usage_para::text; + + return p; +} + +// Begin epilogue. +// +// +// End epilogue. + diff --git a/load/load-options.hxx b/load/load-options.hxx new file mode 100644 index 0000000..7b8426d --- /dev/null +++ b/load/load-options.hxx @@ -0,0 +1,719 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef LOAD_LOAD_OPTIONS_HXX +#define LOAD_LOAD_OPTIONS_HXX + +// Begin prologue. +// +// +// End prologue. + +#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 () noexcept; + + unknown_option (const std::string& option); + + const std::string& + option () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const noexcept; + + private: + std::string option_; + }; + + class unknown_argument: public exception + { + public: + virtual + ~unknown_argument () noexcept; + + unknown_argument (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const noexcept; + + private: + std::string argument_; + }; + + class missing_value: public exception + { + public: + virtual + ~missing_value () noexcept; + + missing_value (const std::string& option); + + const std::string& + option () const; + + virtual void + print (::std::ostream&) const; + + virtual const char* + what () const noexcept; + + private: + std::string option_; + }; + + class invalid_value: public exception + { + public: + virtual + ~invalid_value () noexcept; + + 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 noexcept; + + 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 noexcept; + }; + + // 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_; + }; + + template + struct parser; +} + +#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 bool& + ignore_unknown () const; + + bool& + ignore_unknown (); + + void + ignore_unknown (const bool&); + + const bool& + force () const; + + bool& + force (); + + void + force (const bool&); + + const bool& + shallow () const; + + bool& + shallow (); + + void + shallow (const bool&); + + const bool& + ignore_unresolved_tests () const; + + bool& + ignore_unresolved_tests (); + + void + ignore_unresolved_tests (const bool&); + + const std::string& + tenant () const; + + std::string& + tenant (); + + void + tenant (const std::string&); + + bool + tenant_specified () const; + + void + tenant_specified (bool); + + const bool& + tenant_load () const; + + bool& + tenant_load (); + + void + tenant_load (const bool&); + + const bool& + private_ () const; + + bool& + private_ (); + + void + private_ (const bool&); + + const std::string& + interactive () const; + + std::string& + interactive (); + + void + interactive (const std::string&); + + bool + interactive_specified () const; + + void + interactive_specified (bool); + + const std::string& + service_id () const; + + std::string& + service_id (); + + void + service_id (const std::string&); + + bool + service_id_specified () const; + + void + service_id_specified (bool); + + const std::string& + service_type () const; + + std::string& + service_type (); + + void + service_type (const std::string&); + + bool + service_type_specified () const; + + void + service_type_specified (bool); + + const std::string& + service_data () const; + + std::string& + service_data (); + + void + service_data (const std::string&); + + bool + service_data_specified () const; + + void + service_data_specified (bool); + + const brep::path& + overrides_file () const; + + brep::path& + overrides_file (); + + void + overrides_file (const brep::path&); + + bool + overrides_file_specified () const; + + void + overrides_file_specified (bool); + + const std::string& + db_user () const; + + std::string& + db_user (); + + void + db_user (const std::string&); + + bool + db_user_specified () const; + + void + db_user_specified (bool); + + const std::string& + db_password () const; + + std::string& + db_password (); + + void + db_password (const std::string&); + + bool + db_password_specified () const; + + void + db_password_specified (bool); + + const std::string& + db_name () const; + + std::string& + db_name (); + + void + db_name (const std::string&); + + bool + db_name_specified () const; + + void + db_name_specified (bool); + + const std::string& + db_host () const; + + std::string& + db_host (); + + void + db_host (const std::string&); + + bool + db_host_specified () const; + + void + db_host_specified (bool); + + const std::uint16_t& + db_port () const; + + std::uint16_t& + db_port (); + + void + db_port (const std::uint16_t&); + + bool + db_port_specified () const; + + void + db_port_specified (bool); + + const brep::path& + bpkg () const; + + brep::path& + bpkg (); + + void + bpkg (const brep::path&); + + bool + bpkg_specified () const; + + void + bpkg_specified (bool); + + const brep::strings& + bpkg_option () const; + + brep::strings& + bpkg_option (); + + void + bpkg_option (const brep::strings&); + + bool + bpkg_option_specified () const; + + void + bpkg_option_specified (bool); + + const brep::path& + openssl () const; + + brep::path& + openssl (); + + void + openssl (const brep::path&); + + bool + openssl_specified () const; + + void + openssl_specified (bool); + + const brep::strings& + openssl_option () const; + + brep::strings& + openssl_option (); + + void + openssl_option (const brep::strings&); + + bool + openssl_option_specified () const; + + void + openssl_option_specified (bool); + + const std::string& + pager () const; + + std::string& + pager (); + + void + pager (const std::string&); + + bool + pager_specified () const; + + void + pager_specified (bool); + + const std::vector& + pager_option () const; + + std::vector& + pager_option (); + + void + pager_option (const std::vector&); + + bool + pager_option_specified () const; + + void + pager_option_specified (bool); + + const bool& + help () const; + + bool& + help (); + + void + help (const bool&); + + const bool& + version () const; + + bool& + version (); + + void + version (const 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: + bool ignore_unknown_; + bool force_; + bool shallow_; + bool ignore_unresolved_tests_; + std::string tenant_; + bool tenant_specified_; + bool tenant_load_; + bool private__; + std::string interactive_; + bool interactive_specified_; + std::string service_id_; + bool service_id_specified_; + std::string service_type_; + bool service_type_specified_; + std::string service_data_; + bool service_data_specified_; + brep::path overrides_file_; + bool overrides_file_specified_; + std::string db_user_; + bool db_user_specified_; + std::string db_password_; + bool db_password_specified_; + std::string db_name_; + bool db_name_specified_; + std::string db_host_; + bool db_host_specified_; + std::uint16_t db_port_; + bool db_port_specified_; + brep::path bpkg_; + bool bpkg_specified_; + brep::strings bpkg_option_; + bool bpkg_option_specified_; + brep::path openssl_; + bool openssl_specified_; + brep::strings openssl_option_; + bool openssl_option_specified_; + std::string pager_; + bool pager_specified_; + std::vector pager_option_; + bool pager_option_specified_; + bool help_; + bool version_; +}; + +// Print page usage information. +// +::cli::usage_para +print_usage (::std::ostream&, + ::cli::usage_para = ::cli::usage_para::none); + +#include + +// Begin epilogue. +// +// +// End epilogue. + +#endif // LOAD_LOAD_OPTIONS_HXX diff --git a/load/load-options.ixx b/load/load-options.ixx new file mode 100644 index 0000000..256573d --- /dev/null +++ b/load/load-options.ixx @@ -0,0 +1,809 @@ +// -*- 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_; + } + + // 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_; + } +} + +// options +// + +inline const bool& options:: +ignore_unknown () const +{ + return this->ignore_unknown_; +} + +inline bool& options:: +ignore_unknown () +{ + return this->ignore_unknown_; +} + +inline void options:: +ignore_unknown (const bool& x) +{ + this->ignore_unknown_ = x; +} + +inline const bool& options:: +force () const +{ + return this->force_; +} + +inline bool& options:: +force () +{ + return this->force_; +} + +inline void options:: +force (const bool& x) +{ + this->force_ = x; +} + +inline const bool& options:: +shallow () const +{ + return this->shallow_; +} + +inline bool& options:: +shallow () +{ + return this->shallow_; +} + +inline void options:: +shallow (const bool& x) +{ + this->shallow_ = x; +} + +inline const bool& options:: +ignore_unresolved_tests () const +{ + return this->ignore_unresolved_tests_; +} + +inline bool& options:: +ignore_unresolved_tests () +{ + return this->ignore_unresolved_tests_; +} + +inline void options:: +ignore_unresolved_tests (const bool& x) +{ + this->ignore_unresolved_tests_ = x; +} + +inline const std::string& options:: +tenant () const +{ + return this->tenant_; +} + +inline std::string& options:: +tenant () +{ + return this->tenant_; +} + +inline void options:: +tenant (const std::string& x) +{ + this->tenant_ = x; +} + +inline bool options:: +tenant_specified () const +{ + return this->tenant_specified_; +} + +inline void options:: +tenant_specified (bool x) +{ + this->tenant_specified_ = x; +} + +inline const bool& options:: +tenant_load () const +{ + return this->tenant_load_; +} + +inline bool& options:: +tenant_load () +{ + return this->tenant_load_; +} + +inline void options:: +tenant_load (const bool& x) +{ + this->tenant_load_ = x; +} + +inline const bool& options:: +private_ () const +{ + return this->private__; +} + +inline bool& options:: +private_ () +{ + return this->private__; +} + +inline void options:: +private_ (const bool& x) +{ + this->private__ = x; +} + +inline const std::string& options:: +interactive () const +{ + return this->interactive_; +} + +inline std::string& options:: +interactive () +{ + return this->interactive_; +} + +inline void options:: +interactive (const std::string& x) +{ + this->interactive_ = x; +} + +inline bool options:: +interactive_specified () const +{ + return this->interactive_specified_; +} + +inline void options:: +interactive_specified (bool x) +{ + this->interactive_specified_ = x; +} + +inline const std::string& options:: +service_id () const +{ + return this->service_id_; +} + +inline std::string& options:: +service_id () +{ + return this->service_id_; +} + +inline void options:: +service_id (const std::string& x) +{ + this->service_id_ = x; +} + +inline bool options:: +service_id_specified () const +{ + return this->service_id_specified_; +} + +inline void options:: +service_id_specified (bool x) +{ + this->service_id_specified_ = x; +} + +inline const std::string& options:: +service_type () const +{ + return this->service_type_; +} + +inline std::string& options:: +service_type () +{ + return this->service_type_; +} + +inline void options:: +service_type (const std::string& x) +{ + this->service_type_ = x; +} + +inline bool options:: +service_type_specified () const +{ + return this->service_type_specified_; +} + +inline void options:: +service_type_specified (bool x) +{ + this->service_type_specified_ = x; +} + +inline const std::string& options:: +service_data () const +{ + return this->service_data_; +} + +inline std::string& options:: +service_data () +{ + return this->service_data_; +} + +inline void options:: +service_data (const std::string& x) +{ + this->service_data_ = x; +} + +inline bool options:: +service_data_specified () const +{ + return this->service_data_specified_; +} + +inline void options:: +service_data_specified (bool x) +{ + this->service_data_specified_ = x; +} + +inline const brep::path& options:: +overrides_file () const +{ + return this->overrides_file_; +} + +inline brep::path& options:: +overrides_file () +{ + return this->overrides_file_; +} + +inline void options:: +overrides_file (const brep::path& x) +{ + this->overrides_file_ = x; +} + +inline bool options:: +overrides_file_specified () const +{ + return this->overrides_file_specified_; +} + +inline void options:: +overrides_file_specified (bool x) +{ + this->overrides_file_specified_ = x; +} + +inline const std::string& options:: +db_user () const +{ + return this->db_user_; +} + +inline std::string& options:: +db_user () +{ + return this->db_user_; +} + +inline void options:: +db_user (const std::string& x) +{ + this->db_user_ = x; +} + +inline bool options:: +db_user_specified () const +{ + return this->db_user_specified_; +} + +inline void options:: +db_user_specified (bool x) +{ + this->db_user_specified_ = x; +} + +inline const std::string& options:: +db_password () const +{ + return this->db_password_; +} + +inline std::string& options:: +db_password () +{ + return this->db_password_; +} + +inline void options:: +db_password (const std::string& x) +{ + this->db_password_ = x; +} + +inline bool options:: +db_password_specified () const +{ + return this->db_password_specified_; +} + +inline void options:: +db_password_specified (bool x) +{ + this->db_password_specified_ = x; +} + +inline const std::string& options:: +db_name () const +{ + return this->db_name_; +} + +inline std::string& options:: +db_name () +{ + return this->db_name_; +} + +inline void options:: +db_name (const std::string& x) +{ + this->db_name_ = x; +} + +inline bool options:: +db_name_specified () const +{ + return this->db_name_specified_; +} + +inline void options:: +db_name_specified (bool x) +{ + this->db_name_specified_ = x; +} + +inline const std::string& options:: +db_host () const +{ + return this->db_host_; +} + +inline std::string& options:: +db_host () +{ + return this->db_host_; +} + +inline void options:: +db_host (const std::string& x) +{ + this->db_host_ = x; +} + +inline bool options:: +db_host_specified () const +{ + return this->db_host_specified_; +} + +inline void options:: +db_host_specified (bool x) +{ + this->db_host_specified_ = x; +} + +inline const std::uint16_t& options:: +db_port () const +{ + return this->db_port_; +} + +inline std::uint16_t& options:: +db_port () +{ + return this->db_port_; +} + +inline void options:: +db_port (const std::uint16_t& x) +{ + this->db_port_ = x; +} + +inline bool options:: +db_port_specified () const +{ + return this->db_port_specified_; +} + +inline void options:: +db_port_specified (bool x) +{ + this->db_port_specified_ = x; +} + +inline const brep::path& options:: +bpkg () const +{ + return this->bpkg_; +} + +inline brep::path& options:: +bpkg () +{ + return this->bpkg_; +} + +inline void options:: +bpkg (const brep::path& x) +{ + this->bpkg_ = x; +} + +inline bool options:: +bpkg_specified () const +{ + return this->bpkg_specified_; +} + +inline void options:: +bpkg_specified (bool x) +{ + this->bpkg_specified_ = x; +} + +inline const brep::strings& options:: +bpkg_option () const +{ + return this->bpkg_option_; +} + +inline brep::strings& options:: +bpkg_option () +{ + return this->bpkg_option_; +} + +inline void options:: +bpkg_option (const brep::strings& x) +{ + this->bpkg_option_ = x; +} + +inline bool options:: +bpkg_option_specified () const +{ + return this->bpkg_option_specified_; +} + +inline void options:: +bpkg_option_specified (bool x) +{ + this->bpkg_option_specified_ = x; +} + +inline const brep::path& options:: +openssl () const +{ + return this->openssl_; +} + +inline brep::path& options:: +openssl () +{ + return this->openssl_; +} + +inline void options:: +openssl (const brep::path& x) +{ + this->openssl_ = x; +} + +inline bool options:: +openssl_specified () const +{ + return this->openssl_specified_; +} + +inline void options:: +openssl_specified (bool x) +{ + this->openssl_specified_ = x; +} + +inline const brep::strings& options:: +openssl_option () const +{ + return this->openssl_option_; +} + +inline brep::strings& options:: +openssl_option () +{ + return this->openssl_option_; +} + +inline void options:: +openssl_option (const brep::strings& x) +{ + this->openssl_option_ = x; +} + +inline bool options:: +openssl_option_specified () const +{ + return this->openssl_option_specified_; +} + +inline void options:: +openssl_option_specified (bool x) +{ + this->openssl_option_specified_ = x; +} + +inline const std::string& options:: +pager () const +{ + return this->pager_; +} + +inline std::string& options:: +pager () +{ + return this->pager_; +} + +inline void options:: +pager (const std::string& x) +{ + this->pager_ = x; +} + +inline bool options:: +pager_specified () const +{ + return this->pager_specified_; +} + +inline void options:: +pager_specified (bool x) +{ + this->pager_specified_ = x; +} + +inline const std::vector& options:: +pager_option () const +{ + return this->pager_option_; +} + +inline std::vector& options:: +pager_option () +{ + return this->pager_option_; +} + +inline void options:: +pager_option (const std::vector& x) +{ + this->pager_option_ = x; +} + +inline bool options:: +pager_option_specified () const +{ + return this->pager_option_specified_; +} + +inline void options:: +pager_option_specified (bool x) +{ + this->pager_option_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; +} + +// Begin epilogue. +// +// +// End epilogue. -- cgit v1.1