summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-09-03 16:38:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-09-03 16:38:40 +0200
commitc3f214e5f820d298129e558d64c10e8826bf84ef (patch)
treeb165c0680e09475125a4ef896f8c43fb828f076d /cli
parent90a548af2ca2688ccd40531a1b0359ab33ba1324 (diff)
Add --omit-link-check option
Diffstat (limited to 'cli')
-rw-r--r--cli/context.cxx25
-rw-r--r--cli/options.cli6
-rw-r--r--cli/options.cxx11
-rw-r--r--cli/options.hxx4
-rw-r--r--cli/options.ixx6
5 files changed, 41 insertions, 11 deletions
diff --git a/cli/context.cxx b/cli/context.cxx
index 6e2ac4c..1513e8a 100644
--- a/cli/context.cxx
+++ b/cli/context.cxx
@@ -2158,21 +2158,24 @@ end_toc ()
void context::
verify_id_ref ()
{
- bool f (false);
-
- for (id_set_type::const_iterator i (ref_set.begin ());
- i != ref_set.end ();
- ++i)
+ if (!options.omit_link_check ())
{
- if (id_set.find (*i) == id_set.end ())
+ bool f (false);
+
+ for (id_set_type::const_iterator i (ref_set.begin ());
+ i != ref_set.end ();
+ ++i)
{
- cerr << "error: no id for fragment link '#" << *i << "'" << endl;
- f = true;
+ if (id_set.find (*i) == id_set.end ())
+ {
+ cerr << "error: no id for fragment link '#" << *i << "'" << endl;
+ f = true;
+ }
}
- }
- if (f)
- throw generation_failed ();
+ if (f)
+ throw generation_failed ();
+ }
id_set.clear ();
ref_set.clear ();
diff --git a/cli/options.cli b/cli/options.cli
index a7e1cee..8b9ff5f 100644
--- a/cli/options.cli
+++ b/cli/options.cli
@@ -278,6 +278,12 @@ class options
'\cb{h2}', etc)."
};
+ bool --omit-link-check
+ {
+ "Don't check that local fragment link references (\\l{#ref ...}) resolve
+ to ids."
+ };
+
// Prologues.
//
std::vector<std::string> --hxx-prologue
diff --git a/cli/options.cxx b/cli/options.cxx
index 823dcd4..1511b1c 100644
--- a/cli/options.cxx
+++ b/cli/options.cxx
@@ -610,6 +610,7 @@ options ()
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -743,6 +744,7 @@ options (int& argc,
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -879,6 +881,7 @@ options (int start,
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -1015,6 +1018,7 @@ options (int& argc,
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -1153,6 +1157,7 @@ options (int start,
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -1287,6 +1292,7 @@ options (::cli::scanner& s,
link_regex_trace_ (),
html_heading_map_ (),
html_heading_map_specified_ (false),
+ omit_link_check_ (),
hxx_prologue_ (),
hxx_prologue_specified_ (false),
ixx_prologue_ (),
@@ -1475,6 +1481,9 @@ print_usage (::std::ostream& os, ::cli::usage_para p)
<< " 'h', and '2') to HTML heading <h> (for example," << ::std::endl
<< " 'h1', 'h2', etc)." << ::std::endl;
+ os << "--omit-link-check Don't check that local fragment link references" << ::std::endl
+ << " (\\l{#ref ...}) resolve to ids." << ::std::endl;
+
os << "--hxx-prologue <text> Insert <text> at the beginning of the generated" << ::std::endl
<< " C++ header file." << ::std::endl;
@@ -1700,6 +1709,8 @@ struct _cli_options_map_init
_cli_options_map_["--html-heading-map"] =
&::cli::thunk< options, std::map<char, std::string>, &options::html_heading_map_,
&options::html_heading_map_specified_ >;
+ _cli_options_map_["--omit-link-check"] =
+ &::cli::thunk< options, bool, &options::omit_link_check_ >;
_cli_options_map_["--hxx-prologue"] =
&::cli::thunk< options, std::vector<std::string>, &options::hxx_prologue_,
&options::hxx_prologue_specified_ >;
diff --git a/cli/options.hxx b/cli/options.hxx
index ed54bb2..f47fa3c 100644
--- a/cli/options.hxx
+++ b/cli/options.hxx
@@ -534,6 +534,9 @@ class options
bool
html_heading_map_specified () const;
+ const bool&
+ omit_link_check () const;
+
const std::vector<std::string>&
hxx_prologue () const;
@@ -831,6 +834,7 @@ class options
bool link_regex_trace_;
std::map<char, std::string> html_heading_map_;
bool html_heading_map_specified_;
+ bool omit_link_check_;
std::vector<std::string> hxx_prologue_;
bool hxx_prologue_specified_;
std::vector<std::string> ixx_prologue_;
diff --git a/cli/options.ixx b/cli/options.ixx
index 609d5a9..df89810 100644
--- a/cli/options.ixx
+++ b/cli/options.ixx
@@ -493,6 +493,12 @@ html_heading_map_specified () const
return this->html_heading_map_specified_;
}
+inline const bool& options::
+omit_link_check () const
+{
+ return this->omit_link_check_;
+}
+
inline const std::vector<std::string>& options::
hxx_prologue () const
{