diff options
Diffstat (limited to 'cli/cli.cxx')
-rw-r--r-- | cli/cli.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/cli.cxx b/cli/cli.cxx index 4aaa2d6..b2c6695 100644 --- a/cli/cli.cxx +++ b/cli/cli.cxx @@ -7,11 +7,15 @@ #include <fstream> #include <iostream> +#include <cutl/compiler/code-stream.hxx> + +#include "usage.hxx" #include "options.hxx" #include "parser.hxx" #include "generator.hxx" using namespace std; +using namespace cutl; int main (int argc, char* argv[]) { @@ -22,6 +26,8 @@ int main (int argc, char* argv[]) int end; options ops (argc, argv, end); + // Handle --version + // if (ops.version ()) { e << "CodeSynthesis CLI command line interface compiler 0.0.2" << endl @@ -34,6 +40,29 @@ int main (int argc, char* argv[]) return 0; } + // Handle --help + // + if (ops.help ()) + { + e << "Usage: " << argv[0] << " [options] file" + << endl + << "Options:" << endl; + + compiler::ostream_filter<usage_indenter, char> filt (e); + + e << "--help" << endl + << " Print usage information and exit." + << endl; + + e << "--version" << endl + << " Print version and exit." + << endl; + + generator::usage (); + + return 0; + } + if (end == argc) { e << "error: no input file specified" << endl |