diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-11-08 15:35:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-11-08 15:35:19 +0200 |
commit | 369470005607b9501a769be0ae2a4c79c90bad84 (patch) | |
tree | 459030d6b0ca4f1799d0313a5e63fc24038cd34d /cli/generator.cxx | |
parent | 907b5fed58d53bbb5e25c590df97f01a0ac93733 (diff) |
Implement usage generation
Also migrate the CLI compiler usage handling to the auto-generated version.
Diffstat (limited to 'cli/generator.cxx')
-rw-r--r-- | cli/generator.cxx | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/cli/generator.cxx b/cli/generator.cxx index 89270bb..e0e5d4a 100644 --- a/cli/generator.cxx +++ b/cli/generator.cxx @@ -31,64 +31,6 @@ using namespace cutl; using semantics::path; -void generator:: -usage () -{ - ostream& e (cerr); - - e << "--output-dir | -o <dir>" << endl - << " Write generated files to <dir>." << endl; - - e << "--suppress-inline" << endl - << " Generate all functions non-inline." << endl; - - e << "--hxx-suffix <suffix>" << endl - << " Use <suffix> instead of the default '.hxx' to\n" - << " construct the name of the generated header file." - << endl; - - e << "--ixx-suffix <suffix>" << endl - << " Use <suffix> instead of the default '.ixx' to\n" - << " construct the name of the generated inline file." - << endl; - - e << "--cxx-suffix <suffix>" << endl - << " Use <suffix> instead of the default '.cxx' to\n" - << " construct the name of the generated source file." - << endl; - - e << "--option-prefix <prefix>" << endl - << " Use <prefix> instead of the default '-' as an\n" - << " option prefix." - << endl; - - e << "--option-separator <sep>" << endl - << " Use <sep> instead of the default '--' as an\n" - << " optional separator between options and arguments." - << endl; - - e << "--include-with-brackets" << endl - << " Use angle brackets (<>) instead of quotes (\"\") in\n" - << " generated #include directives." - << endl; - - e << "--include-prefix <prefix>" << endl - << " Add <prefix> to generated #include directive\n" - << " paths." - << endl; - - e << "--guard-prefix <prefix>" << endl - << " Add <prefix> to generated header inclusion guards." - << endl; - - e << "--reserved-name <name>" << endl - << " Add <name> to the list of names that should not\n" - << " be used as identifiers. The name can optionally\n" - << " be followed by '=' and the replacement name that\n" - << " should be used instead." - << endl; -} - namespace { static char const header[] = @@ -285,6 +227,12 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) auto_rm.cancel (); } + catch (const generation_failed&) + { + // Code generation failed. Diagnostics has already been issued. + // + throw failed (); + } catch (semantics::invalid_path const& e) { cerr << "error: '" << e.path () << "' is not a valid filesystem path" |