From 2eb28736a05c7083f2b30b501954a789bbd85f88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Sep 2015 15:18:11 +0200 Subject: Add --short-usage option When combined with --long-usage, it makes CLI generate both short and long usage printing code. --- cli/options.hxx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'cli/options.hxx') diff --git a/cli/options.hxx b/cli/options.hxx index d3a9c5c..22495e4 100644 --- a/cli/options.hxx +++ b/cli/options.hxx @@ -1,10 +1,17 @@ -// This code was generated by CLI, a command line interface +// -*- 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 @@ -351,6 +358,8 @@ class options ::cli::unknown_mode option = ::cli::unknown_mode::fail, ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + options (); + // Option accessors. // const bool& @@ -392,6 +401,9 @@ class options const bool& long_usage () const; + const bool& + short_usage () const; + const std::size_t& option_length () const; @@ -520,8 +532,6 @@ class options // Implementation details. // protected: - options (); - bool _parse (const char*, ::cli::scanner&); @@ -545,6 +555,7 @@ class options bool suppress_undocumented_; bool suppress_usage_; bool long_usage_; + bool short_usage_; std::size_t option_length_; bool exclude_base_; std::string cli_namespace_; @@ -589,4 +600,9 @@ class options #include "options.ixx" +// Begin epilogue. +// +// +// End epilogue. + #endif // CLI_OPTIONS_HXX -- cgit v1.1