summaryrefslogtreecommitdiff
path: root/cli/source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cli/source.cxx')
-rw-r--r--cli/source.cxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/cli/source.cxx b/cli/source.cxx
index 6a8ea76..1e0be15 100644
--- a/cli/source.cxx
+++ b/cli/source.cxx
@@ -535,12 +535,18 @@ namespace
if (!abst)
{
- os << name << "::" << endl
- << name << " (int& argc," << endl
+ bool p (options.generate_parse ());
+ string n (
+ p
+ ? "void " + name + "::\n" + (name != "parse" ? "parse" : "parse_")
+ : name + "::\n" + name);
+
+ os << n << " (int& argc," << endl
<< "char** argv," << endl
<< "bool erase," << endl
<< um << " opt," << endl
<< um << " arg)";
+ if (!p)
{
option_init init (*this);
traversal::names names_init (init);
@@ -551,13 +557,13 @@ namespace
<< "_parse (s, opt, arg);"
<< "}";
- os << name << "::" << endl
- << name << " (int start," << endl
+ os << n << " (int start," << endl
<< "int& argc," << endl
<< "char** argv," << endl
<< "bool erase," << endl
<< um << " opt," << endl
<< um << " arg)";
+ if (!p)
{
option_init init (*this);
traversal::names names_init (init);
@@ -568,13 +574,13 @@ namespace
<< "_parse (s, opt, arg);"
<< "}";
- os << name << "::" << endl
- << name << " (int& argc," << endl
+ os << n << " (int& argc," << endl
<< "char** argv," << endl
<< "int& end," << endl
<< "bool erase," << endl
<< um << " opt," << endl
<< um << " arg)";
+ if (!p)
{
option_init init (*this);
traversal::names names_init (init);
@@ -586,14 +592,14 @@ namespace
<< "end = s.end ();"
<< "}";
- os << name << "::" << endl
- << name << " (int start," << endl
+ os << n << " (int start," << endl
<< "int& argc," << endl
<< "char** argv," << endl
<< "int& end," << endl
<< "bool erase," << endl
<< um << " opt," << endl
<< um << " arg)";
+ if (!p)
{
option_init init (*this);
traversal::names names_init (init);
@@ -605,10 +611,10 @@ namespace
<< "end = s.end ();"
<< "}";
- os << name << "::" << endl
- << name << " (" << cli << "::scanner& s," << endl
+ os << n << " (" << cli << "::scanner& s," << endl
<< um << " opt," << endl
<< um << " arg)";
+ if (!p)
{
option_init init (*this);
traversal::names names_init (init);