From 369470005607b9501a769be0ae2a4c79c90bad84 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Nov 2009 15:35:19 +0200 Subject: Implement usage generation Also migrate the CLI compiler usage handling to the auto-generated version. --- cli/options.hxx | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'cli/options.hxx') diff --git a/cli/options.hxx b/cli/options.hxx index 4d33939..6f1210f 100644 --- a/cli/options.hxx +++ b/cli/options.hxx @@ -141,6 +141,8 @@ namespace cli #include +#include + class options { public: @@ -171,47 +173,57 @@ class options // Option accessors. // - public: - bool const& + const bool& help () const; - bool const& + const bool& version () const; - std::string const& + const std::string& output_dir () const; - bool const& + const bool& suppress_inline () const; - std::string const& + const bool& + suppress_usage () const; + + const std::size_t& + option_length () const; + + const std::string& hxx_suffix () const; - std::string const& + const std::string& ixx_suffix () const; - std::string const& + const std::string& cxx_suffix () const; - std::string const& + const std::string& option_prefix () const; - std::string const& + const std::string& option_separator () const; - bool const& + const bool& include_with_brackets () const; - std::string const& + const std::string& include_prefix () const; - std::string const& + const std::string& guard_prefix () const; - std::map const& + const std::map& reserved_name () const; + // Print usage information. + // + static void + print_usage (::std::ostream&); + private: int _parse (int start, @@ -225,6 +237,8 @@ class options bool version_; std::string output_dir_; bool suppress_inline_; + bool suppress_usage_; + std::size_t option_length_; std::string hxx_suffix_; std::string ixx_suffix_; std::string cxx_suffix_; -- cgit v1.1