diff options
Diffstat (limited to 'xsd/xsd/xsd.cxx')
-rw-r--r-- | xsd/xsd/xsd.cxx | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/xsd/xsd/xsd.cxx b/xsd/xsd/xsd.cxx index f1d22fc..d2b0faf 100644 --- a/xsd/xsd/xsd.cxx +++ b/xsd/xsd/xsd.cxx @@ -196,7 +196,7 @@ main (int argc, char* argv[]) { o << "The compiler was invoked in the Proprietary License mode. You " << "should have\nreceived a proprietary license from Code Synthesis " - << "Tools CC that entitles\nyou to use it in this mode." << endl; + << "that entitles you to\nuse it in this mode." << endl; } else { @@ -298,6 +298,14 @@ main (int argc, char* argv[]) ? static_cast<CXX::options&> (*tree_ops) : static_cast<CXX::options&> (*parser_ops)); + // Validate options. + // + if (common_ops.file_list_only () && !common_ops.file_list_specified ()) + { + e << "error: --file-list-only specified without --file-list" << endl; + return 1; + } + // Disabled warnings. // WarningSet disabled_w; @@ -770,38 +778,43 @@ main (int argc, char* argv[]) try { OutputFileStream ofs; - SemanticGraph::Path path (fl); + if (fl != "-") + { + SemanticGraph::Path path (fl); - ofs.open (path.string ().c_str (), ios_base::out); + ofs.open (path.string ().c_str (), ios_base::out); - if (!ofs.is_open ()) - { - wcerr << path << ": error: unable to open in write mode" << endl; - return 1; + if (!ofs.is_open ()) + { + wcerr << path << ": error: unable to open in write mode" << endl; + return 1; + } } + std::ostream& os (ofs.is_open () ? ofs : cout); + NarrowString d (common_ops.file_list_delim ()); expand_nl (d); if (NarrowString p = common_ops.file_list_prologue ()) { expand_nl (p); - ofs << p; + os << p; } for (FileList::iterator i (file_list.begin ()), e (file_list.end ()); i != e;) { - ofs << *i; + os << *i; if (++i != e) - ofs << d; + os << d; } if (NarrowString e = common_ops.file_list_epilogue ()) { expand_nl (e); - ofs << e; + os << e; } } catch (SemanticGraph::InvalidPath const&) |