From 813e4744038ec3a1ca8095111074c1cb2a824d83 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Nov 2015 14:53:52 +0200 Subject: Implement entire page usage generation --- doc/cli.1 | 20 ++++++++++++++++++++ doc/cli.xhtml | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'doc') diff --git a/doc/cli.1 b/doc/cli.1 index 663fdaf..a50a1bc 100644 --- a/doc/cli.1 +++ b/doc/cli.1 @@ -116,6 +116,26 @@ usage versions\. In this mode, the usage printing functions are called \fBprint_short_usage()\fR and \fBprint_long_usage()\fR and for the long usage 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 +two functions are generated with the \fB*short_usage()\fR and +\fB*long_usage()\fR suffixes\. .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, diff --git a/doc/cli.xhtml b/doc/cli.xhtml index 305087c..92f237b 100644 --- a/doc/cli.xhtml +++ b/doc/cli.xhtml @@ -159,6 +159,26 @@ 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 two + functions are generated with the *short_usage() and + *long_usage() suffixes.

+
--option-length len
Indent option descriptions len characters when printing usage. This is useful when you have multiple options classes, potentially in -- cgit v1.1