From: Michael D. Lowis Date: Tue, 21 Oct 2014 20:56:29 +0000 (-0400) Subject: Added hardcoded usage string X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c5b55ac7310ec28dd8c08ee7e9db8f474fe41b9f;p=proto%2Fsclpl.git Added hardcoded usage string --- diff --git a/source/sclpl/main.c b/source/sclpl/main.c index d3211f5..5c8182f 100644 --- a/source/sclpl/main.c +++ b/source/sclpl/main.c @@ -9,6 +9,7 @@ /* Command Line Options *****************************************************************************/ +const char Usage[] = "Usage: sclpl [OPTION]... MODE [FILE]...\n"; opts_cfg_t Options_Config[] = { {"tokens", false, "mode", "Emit the token output of lexical analysis for the given file"}, {"ast", false, "mode", "Emit the abstract syntax tree for the given file"}, @@ -17,8 +18,8 @@ opts_cfg_t Options_Config[] = { {"staticlib", false, "mode", "Compile the application as a static library"}, {"sharedlib", false, "mode", "Compile the application as a shared library"}, {"program", false, "mode", "Compile the application as an executable"}, - {"e", true, "entry", "Specify the module that contains the entry point for the executable"}, {"entry", true, "entry", "Specify the module that contains the entry point for the executable"}, + {"e", true, "entry", "Specify the module that contains the entry point for the executable"}, {"R", true, "include", "Add a path to the list of require paths"}, {NULL, false, NULL, NULL } }; @@ -40,7 +41,7 @@ void print_usage(void) { } /* Print the usage and option list */ - printf("Usage: [OPTION]... [MODE] [FILE]\n\n"); + puts(Usage); size_t padding = sz + 4 + ((opts_have_args) ? 4 : 0); char* buffer = (char*)malloc(padding+1); opts = &Options_Config[0];