summaryrefslogtreecommitdiff
path: root/cli/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-11-08 15:35:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-11-08 15:35:19 +0200
commit369470005607b9501a769be0ae2a4c79c90bad84 (patch)
tree459030d6b0ca4f1799d0313a5e63fc24038cd34d /cli/context.hxx
parent907b5fed58d53bbb5e25c590df97f01a0ac93733 (diff)
Implement usage generation
Also migrate the CLI compiler usage handling to the auto-generated version.
Diffstat (limited to 'cli/context.hxx')
-rw-r--r--cli/context.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/context.hxx b/cli/context.hxx
index 1f2facb..194c008 100644
--- a/cli/context.hxx
+++ b/cli/context.hxx
@@ -20,6 +20,8 @@
using std::endl;
+class generation_failed {};
+
class context
{
public:
@@ -36,6 +38,8 @@ public:
semantics::cli_unit& unit;
options_type const& options;
+ bool usage;
+
string const& inl;
string const& opt_prefix;
string const& opt_sep;
@@ -59,6 +63,16 @@ public:
string
escape (string const&) const;
+ // Format the documentation string.
+ //
+ enum output_type
+ {
+ ot_plain
+ };
+
+ static string
+ format (string const&, output_type);
+
public:
static string const&
ename (semantics::nameable& n)