From 369470005607b9501a769be0ae2a4c79c90bad84 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Nov 2009 15:35:19 +0200 Subject: Implement usage generation Also migrate the CLI compiler usage handling to the auto-generated version. --- cli/generator.cxx | 64 ++++++------------------------------------------------- 1 file changed, 6 insertions(+), 58 deletions(-) (limited to 'cli/generator.cxx') 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 " << endl - << " Write generated files to ." << endl; - - e << "--suppress-inline" << endl - << " Generate all functions non-inline." << endl; - - e << "--hxx-suffix " << endl - << " Use instead of the default '.hxx' to\n" - << " construct the name of the generated header file." - << endl; - - e << "--ixx-suffix " << endl - << " Use instead of the default '.ixx' to\n" - << " construct the name of the generated inline file." - << endl; - - e << "--cxx-suffix " << endl - << " Use instead of the default '.cxx' to\n" - << " construct the name of the generated source file." - << endl; - - e << "--option-prefix " << endl - << " Use instead of the default '-' as an\n" - << " option prefix." - << endl; - - e << "--option-separator " << endl - << " Use 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 " << endl - << " Add to generated #include directive\n" - << " paths." - << endl; - - e << "--guard-prefix " << endl - << " Add to generated header inclusion guards." - << endl; - - e << "--reserved-name " << endl - << " Add 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" -- cgit v1.1