diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-02 15:18:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-02 15:18:11 +0200 |
commit | 2eb28736a05c7083f2b30b501954a789bbd85f88 (patch) | |
tree | 9cd38c69d7ce26d45e4180f1cca8808f54309f7f /cli/context.cxx | |
parent | 957fd18c38e3bb1c9c489b40a0cbdf865e821294 (diff) |
Add --short-usage option
When combined with --long-usage, it makes CLI generate both short
and long usage printing code.
Diffstat (limited to 'cli/context.cxx')
-rw-r--r-- | cli/context.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/context.cxx b/cli/context.cxx index af6b58f..1324b0c 100644 --- a/cli/context.cxx +++ b/cli/context.cxx @@ -101,7 +101,6 @@ context (ostream& os_, options (ops), modifier (options.generate_modifier ()), specifier (options.generate_specifier ()), - usage (!options.suppress_usage ()), inl (data_->inl_), opt_prefix (options.option_prefix ()), opt_sep (options.option_separator ()), @@ -109,6 +108,16 @@ context (ostream& os_, reserved_name_map (options.reserved_name ()), keyword_set (data_->keyword_set_) { + if (options.suppress_usage ()) + usage = ut_none; + else + { + if (options.long_usage ()) + usage = options.short_usage () ? ut_both : ut_long; + else + usage = ut_short; + } + if (!options.suppress_inline ()) data_->inl_ = "inline "; |