Better consistency in usage display

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-03-09 21:42:38 +00:00
commit b69b793d8e
21 changed files with 150 additions and 127 deletions

View file

@ -96,24 +96,28 @@ check-aliveness:
test -x ./$(TARGET)
./$(TARGET) -version
./$(TARGET) -help
@$(skip-tcl) || ./$(TARGET) -tcl -help
@$(skip-perl5) || ./$(TARGET) -perl -help
@$(skip-python) || ./$(TARGET) -python -help
@$(skip-java) || ./$(TARGET) -java -help
@$(skip-guile) || ./$(TARGET) -guile -help
@$(skip-mzscheme) || ./$(TARGET) -mzscheme -help
@$(skip-ruby) || ./$(TARGET) -ruby -help
@$(skip-ocaml) || ./$(TARGET) -ocaml -help
@$(skip-octave) || ./$(TARGET) -octave -help
@$(skip-php) || ./$(TARGET) -php -help
@$(skip-pike) || ./$(TARGET) -pike -help
@$(skip-chicken) || ./$(TARGET) -chicken -help
@$(skip-csharp) || ./$(TARGET) -csharp -help
@$(skip-modula3) || ./$(TARGET) -modula3 -help
@$(skip-lua) || ./$(TARGET) -lua -help
@$(skip-r) || ./$(TARGET) -r -help
@$(skip-go) || ./$(TARGET) -go -help
@$(skip-d) || ./$(TARGET) -d -help
@$(skip-tcl) || ./$(TARGET) -tcl -help
@$(skip-perl5) || ./$(TARGET) -perl -help
@$(skip-python) || ./$(TARGET) -python -help
@$(skip-java) || ./$(TARGET) -java -help
@$(skip-guile) || ./$(TARGET) -guile -help
@$(skip-mzscheme) || ./$(TARGET) -mzscheme -help
@$(skip-ruby) || ./$(TARGET) -ruby -help
@$(skip-ocaml) || ./$(TARGET) -ocaml -help
@$(skip-octave) || ./$(TARGET) -octave -help
@$(skip-php) || ./$(TARGET) -php -help
@$(skip-pike) || ./$(TARGET) -pike -help
@$(skip-chicken) || ./$(TARGET) -chicken -help
@$(skip-csharp) || ./$(TARGET) -csharp -help
@$(skip-modula3) || ./$(TARGET) -modula3 -help
@$(skip-allegrocl)|| ./$(TARGET) -allegrocl -help
@$(skip-clisp) || ./$(TARGET) -clisp -help
@$(skip-uffi) || ./$(TARGET) -uffi -help
@$(skip-cffi) || ./$(TARGET) -cffi -help
@$(skip-lua) || ./$(TARGET) -lua -help
@$(skip-r) || ./$(TARGET) -r -help
@$(skip-go) || ./$(TARGET) -go -help
@$(skip-d) || ./$(TARGET) -d -help
check-ccache:
test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) check)

View file

@ -22,6 +22,21 @@ char cvsroot_allegrocl_cxx[] = "$Id$";
// #define ALLEGROCL_TYPE_DEBUG
// #define ALLEGROCL_CLASS_DEBUG
static const char *usage = (char *) "\
Allegro CL Options (available with -allegrocl)\n\
-identifier-converter <type or funcname> - \n\
Specifies the type of conversion to do on C identifiers to convert\n\
them to symbols. There are two built-in converters: 'null' and\n\
'lispify'. The default is 'null'. If you supply a name other\n\
than one of the built-ins, then a function by that name will be\n\
called to convert identifiers to symbols.\n\
-[no]cwrap - Turn on or turn off generation of an intermediate C file when\n\
creating a C interface. By default this is only done for C++ code.\n\
-isolate - Define all SWIG helper functions in a package unique to this\n\
module. Avoids redefinition warnings when loading multiple\n\
SWIGged modules into the same running Allegro CL image.\n\
";
static File *f_cl = 0;
String *f_clhead = NewString("");
String *f_clwrap = NewString("(swig-in-package ())\n\n");
@ -1587,21 +1602,7 @@ void ALLEGROCL::main(int argc, char *argv[]) {
}
if (!strcmp(argv[i], "-help")) {
fprintf(stdout, "Allegro CL Options (available with -allegrocl)\n");
fprintf(stdout,
" -identifier-converter <type or funcname>\n"
"\tSpecifies the type of conversion to do on C identifiers to convert\n"
"\tthem to symbols. There are two built-in converters: 'null' and\n"
"\t 'lispify'. The default is 'null'. If you supply a name other\n"
"\tthan one of the built-ins, then a function by that name will be\n"
"\tcalled to convert identifiers to symbols.\n"
"\n"
" -[no]cwrap\n"
"\tTurn on or turn off generation of an intermediate C file when\n" "\tcreating a C interface. By default this is only done for C++ code.\n"
" -isolate\n"
"Define all SWIG helper functions in a package unique to this module. Avoids redefinition warnings when loading multiple SWIGged modules\n"
"into the same running Allegro CL image.\n");
Printf(stdout, "%s\n", usage);
}
}
@ -3230,3 +3231,4 @@ int ALLEGROCL::templateDeclaration(Node *n) {
return SWIG_OK;
}

View file

@ -20,6 +20,19 @@ char cvsroot_cffi_cxx[] = "$Id$";
//#define CFFI_DEBUG
//#define CFFI_WRAP_DEBUG
static const char *usage = (char *) "\
CFFI Options (available with -cffi)\n\
-generate-typedef - Use defctype to generate shortcuts according to the\n\
typedefs in the input.\n\
-[no]cwrap - Turn on or turn off generation of an intermediate C\n\
file when creating a C interface. By default this is\n\
only done for C++ code.\n\
-[no]swig-lisp - Turn on or off generation of code for helper lisp\n\
macro, functions, etc. which SWIG uses while\n\
generating wrappers. These macros, functions may still\n\
be used by generated wrapper code.\n\
";
class CFFI:public Language {
public:
String *f_cl;
@ -80,17 +93,7 @@ void CFFI::main(int argc, char *argv[]) {
CWrap = false;
for (i = 1; i < argc; i++) {
if (!Strcmp(argv[i], "-help")) {
Printf(stdout, "cffi Options (available with -cffi)\n");
Printf(stdout,
" -generate-typedef\n"
"\tIf this option is given then defctype will be used to generate\n"
"\tshortcuts according to the typedefs in the input.\n"
" -[no]cwrap\n"
"\tTurn on or turn off generation of an intermediate C file when\n"
"\tcreating a C interface. By default this is only done for C++ code.\n"
" -[no]swig-lisp\n"
"\tTurns on or off generation of code for helper lisp macro, functions,\n"
"\tetc. which SWIG uses while generating wrappers. These macros, functions\n" "\tmay still be used by generated wrapper code.\n");
Printf(stdout, "%s\n", usage);
} else if (!strcmp(argv[i], "-cwrap")) {
CWrap = true;
Swig_mark_arg(i);

View file

@ -17,17 +17,17 @@ char cvsroot_chicken_cxx[] = "$Id$";
#include <ctype.h>
static const char *chicken_usage = (char *) "\
static const char *usage = (char *) "\
\
CHICKEN Options (available with -chicken)\n\
-proxy - Export TinyCLOS class definitions\n\
-closprefix <prefix> - Prepend <prefix> to all clos identifiers\n\
-useclassprefix - Prepend the class name to all clos identifiers\n\
-unhideprimitive - Unhide the primitive: symbols\n\
-nounit - Do not (declare (unit ...)) in scheme file\n\
-noclosuses - Do not (declare (uses ...)) in scheme file\n\
-nocollection - Do not register pointers with chicken garbage\n\
collector and export destructors\n\
-nounit - Do not (declare (unit ...)) in scheme file\n\
-proxy - Export TinyCLOS class definitions\n\
-unhideprimitive - Unhide the primitive: symbols\n\
-useclassprefix - Prepend the class name to all clos identifiers\n\
\n";
static char *module = 0;
@ -137,7 +137,7 @@ void CHICKEN::main(int argc, char *argv[]) {
for (i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp(argv[i], "-help") == 0) {
fputs(chicken_usage, stdout);
fputs(usage, stdout);
SWIG_exit(0);
} else if (strcmp(argv[i], "-proxy") == 0) {
clos = 1;

View file

@ -15,6 +15,15 @@ char cvsroot_clisp_cxx[] = "$Id$";
#include "swigmod.h"
static const char *usage = (char *) "\
CLISP Options (available with -clisp)\n\
-extern-all - Create clisp definitions for all the functions and\n\
global variables otherwise only definitions for\n\
externed functions and variables are created.\n\
-generate-typedef - Use def-c-type to generate shortcuts according to the\n\
typedefs in the input.\n\
";
class CLISP:public Language {
public:
File *f_cl;
@ -48,15 +57,7 @@ void CLISP::main(int argc, char *argv[]) {
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-help")) {
Printf(stdout, "clisp Options (available with -clisp)\n");
Printf(stdout,
" -extern-all\n"
"\t If this option is given then clisp definitions for all the functions\n"
"and global variables will be created otherwise only definitions for \n"
"externed functions and variables are created.\n"
" -generate-typedef\n"
"\t If this option is given then def-c-type will be used to generate shortcuts\n"
"according to the typedefs in the input.\n");
Printf(stdout, "%s\n", usage);
} else if ((Strcmp(argv[i], "-extern-all") == 0)) {
extern_all_flag = 1;
Swig_mark_arg(i);

View file

@ -4172,5 +4172,5 @@ C# Options (available with -csharp)\n\
-namespace <nm> - Generate wrappers into C# namespace <nm>\n\
-noproxy - Generate the low-level functional interface instead\n\
of proxy classes\n\
-oldvarnames - old intermediary method names for variable wrappers\n\
-oldvarnames - Old intermediary method names for variable wrappers\n\
\n";

View file

@ -4342,10 +4342,10 @@ extern "C" Language *swig_d(void) {
* ----------------------------------------------------------------------------- */
const char *D::usage = (char *) "\
D Options (available with -d)\n\
-splitproxy - Write each D type to a dedicated file instead of\n\
generating a single proxy D module.\n\
-noproxy - Generate the low-level functional interface instead\n\
of proxy classes\n\
-package <pkg> - Write generated D modules into package <pkg>\n\
-splitproxy - Write each D type to a dedicated file instead of\n\
generating a single proxy D module.\n\
-wrapperlibrary <wl> - Sets the name of the wrapper library to <wl>\n\
\n";

View file

@ -4784,9 +4784,9 @@ extern "C" Language *swig_go(void) {
// Usage message.
const char * const GO::usage = (char *) "\
Go Options (available with -go)\n\
-package <name> - Set name of the Go package to <name>\n\
-gccgo - Generate code for gccgo rather than 6g/8g\n\
-go-prefix <p> - Like gccgo -fgo-prefix option\n\
-soname <name> - Set shared library holding C/C++ code to <name>\n\
-longsize <s> - Set size of C/C++ long type--32 or 64 bits\n\
-package <name> - Set name of the Go package to <name>\n\
-soname <name> - Set shared library holding C/C++ code to <name>\n\
\n";

View file

@ -18,19 +18,15 @@ char cvsroot_guile_cxx[] = "$Id$";
#include <ctype.h>
// Note string broken in half for compilers that can't handle long strings
static const char *guile_usage = (char *) "\
static const char *usage = (char *) "\
Guile Options (available with -guile)\n\
-prefix <name> - Use <name> as prefix [default \"gswig_\"]\n\
-package <name> - Set the path of the module to <name>\n\
(default NULL)\n\
-emitsetters - Emit procedures-with-setters for variables\n\
and structure slots.\n\
-onlysetters - Don't emit traditional getter and setter\n\
procedures for structure slots,\n\
only emit procedures-with-setters.\n\
-procdoc <file> - Output procedure documentation to <file>\n\
-procdocformat <format> - Output procedure documentation in <format>;\n\
one of `guile-1.4', `plain', `texinfo'\n\
-emitslotaccessors - Emit accessor methods for all GOOPS slots\n" "\
-exportprimitive - Add the (export ...) code from scmstub into the\n\
GOOPS file.\n\
-gh - Use the gh_ Guile API. (Guile <= 1.8) \n\
-goopsprefix <prefix> - Prepend <prefix> to all goops identifiers\n\
-linkage <lstyle> - Use linkage protocol <lstyle> (default `simple')\n\
Use `module' for native Guile module linking\n\
(requires Guile >= 1.5.0). Use `passive' for\n\
@ -38,18 +34,23 @@ Guile Options (available with -guile)\n\
`ltdlmod' for Guile's old dynamic module\n\
convention (Guile <= 1.4), or `hobbit' for hobbit\n\
modules.\n\
-scmstub - Output Scheme file with module declaration and\n\
exports; only with `passive' and `simple' linkage\n\
-gh - Use the gh_ Guile API. (Guile <= 1.8) \n\
-scm - Use the scm Guile API. (Guile >= 1.6, default) \n\
-onlysetters - Don't emit traditional getter and setter\n\
procedures for structure slots,\n\
only emit procedures-with-setters.\n\
-package <name> - Set the path of the module to <name>\n\
(default NULL)\n\
-prefix <name> - Use <name> as prefix [default \"gswig_\"]\n\
-procdoc <file> - Output procedure documentation to <file>\n\
-procdocformat <format> - Output procedure documentation in <format>;\n\
one of `guile-1.4', `plain', `texinfo'\n\
-proxy - Export GOOPS class definitions\n\
-emitslotaccessors - Emit accessor methods for all GOOPS slots\n" "\
-primsuffix <suffix> - Name appended to primitive module when exporting\n\
GOOPS classes. (default = \"primitive\")\n\
-goopsprefix <prefix> - Prepend <prefix> to all goops identifiers\n\
-scm - Use the scm Guile API. (Guile >= 1.6, default) \n\
-scmstub - Output Scheme file with module declaration and\n\
exports; only with `passive' and `simple' linkage\n\
-useclassprefix - Prepend the class name to all goops identifiers\n\
-exportprimitive - Add the (export ...) code from scmstub into the\n\
GOOPS file.\n";
\n";
static File *f_begin = 0;
static File *f_runtime = 0;
@ -135,7 +136,7 @@ public:
for (i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp(argv[i], "-help") == 0) {
fputs(guile_usage, stdout);
fputs(usage, stdout);
SWIG_exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "-prefix") == 0) {
if (argv[i + 1]) {

View file

@ -4394,6 +4394,6 @@ Java Options (available with -java)\n\
-nopgcpp - Suppress premature garbage collection prevention parameter\n\
-noproxy - Generate the low-level functional interface instead\n\
of proxy classes\n\
-oldvarnames - old intermediary method names for variable wrappers\n\
-package <name> - set name of the Java package to <name>\n\
-oldvarnames - Old intermediary method names for variable wrappers\n\
-package <name> - Set name of the Java package to <name>\n\
\n";

View file

@ -82,8 +82,9 @@ void display_mapping(DOH *d) {
(though for now I have not bothered)
NEW LANGUAGE NOTE:END ************************************************/
static const char *usage = (char *) "\
Lua Options (available with -lua)\n\
(coming soon.)\n\n";
Lua Options (available with -lua)\n\
[no additional options]\n\
\n";
@ -170,7 +171,7 @@ public:
for (int i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp(argv[i], "-help") == 0) { // usage flags
fputs(usage, stderr);
fputs(usage, stdout);
}
}
}

View file

@ -3975,10 +3975,10 @@ extern "C" Language *swig_modula3(void) {
const char *MODULA3::usage = (char *) "\
Modula 3 Options (available with -modula3)\n\
-generateconst <file> - generate code for computing numeric values of constants\n\
-generaterename <file> - generate suggestions for %rename\n\
-generatetypemap <file> - generate templates for some basic typemaps\n\
-oldvarnames - old intermediary method names for variable wrappers\n\
-generateconst <file> - Generate code for computing numeric values of constants\n\
-generaterename <file> - Generate suggestions for %rename\n\
-generatetypemap <file> - Generate templates for some basic typemaps\n\
-oldvarnames - Old intermediary method names for variable wrappers\n\
\n";
/*

View file

@ -19,12 +19,12 @@ char cvsroot_mzscheme_cxx[] = "$Id$";
static const char *usage = (char *) "\
Mzscheme Options (available with -mzscheme)\n\
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
-declaremodule - Create extension that declares a module\n\
-noinit - Do not emit scheme_initialize, scheme_reload,\n\
scheme_module_name functions\n\
-dynamic-load <library>,[library,...] - Do not link with these libraries, dynamic load\n\
them\n\
-noinit - Do not emit scheme_initialize, scheme_reload,\n\
scheme_module_name functions\n\
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
";
static String *fieldnames_tab = 0;

View file

@ -17,11 +17,13 @@ char cvsroot_ocaml_cxx[] = "$Id$";
#include <ctype.h>
static const char *usage = (char *)
("Ocaml Options (available with -ocaml)\n"
"-prefix <name> - Set a prefix <name> to be prepended to all names\n"
"-where - Emit library location\n"
"-suffix <name> - Change .cxx to something else\n" "-oldvarnames - old intermediary method names for variable wrappers\n" "\n");
static const char *usage = (char *) "\
Ocaml Options (available with -ocaml)\n\
-oldvarnames - Old intermediary method names for variable wrappers\n\
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
-suffix <name> - Change .cxx to something else\n\
-where - Emit library location\n\
\n";
static int classmode = 0;
static int in_constructor = 0, in_destructor = 0, in_copyconst = 0;

View file

@ -18,7 +18,7 @@ char cvsroot_octave_cxx[] = "$Id$";
static const char *usage = (char *) "\
Octave Options (available with -octave)\n\
[no additional options]\n\
\n";
\n";
class OCTAVE:public Language {
@ -64,7 +64,7 @@ public:
for (int i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp(argv[i], "-help") == 0) {
fputs(usage, stderr);
fputs(usage, stdout);
}
}
}

View file

@ -21,14 +21,15 @@ static int treduce = SWIG_cparse_template_reduce(0);
static const char *usage = (char *) "\
Perl5 Options (available with -perl5)\n\
-static - Omit code related to dynamic loading\n\
-nopm - Do not generate the .pm file\n\
-proxy - Create proxy classes\n\
-noproxy - Don't create proxy classes\n\
-compat - Compatibility mode\n\
-const - Wrap constants as constants and not variables (implies -proxy)\n\
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-cppcast - Enable C++ casting operators\n\
-compat - Compatibility mode\n\n";
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-nopm - Do not generate the .pm file\n\
-noproxy - Don't create proxy classes\n\
-proxy - Create proxy classes\n\
-static - Omit code related to dynamic loading\n\
\n";
static int compat = 0;

View file

@ -46,7 +46,7 @@ char cvsroot_php_cxx[] = "$Id$";
static const char *usage = (char *) "\
PHP Options (available with -php)\n\
-cppext - cpp file extension (default to .cpp)\n\
-cppext <ext> - Change C++ file extension to <ext> (default is cpp)\n\
-noproxy - Don't generate proxy classes.\n\
-prefix <prefix> - Prepend <prefix> to all class names in PHP wrappers\n\
\n";

View file

@ -37,7 +37,7 @@ char cvsroot_pike_cxx[] = "$Id$";
static const char *usage = (char *) "\
Pike Options (available with -pike)\n\
[None]\n\
[no additional options]\n\
\n";
class PIKE:public Language {

View file

@ -215,12 +215,15 @@ R Options (available with -r)\n\
-copystruct - Emit R code to copy C structs (on by default)\n\
-cppcast - Enable C++ casting operators (default) \n\
-debug - Output debug\n\
-dll <name> - Name of the DLL (without the .dll or .so suffix). Default is the module name.\n\
-dll <name> - Name of the DLL (without the .dll or .so suffix).\n\
Default is the module name.\n\
-gc - Aggressive garbage collection\n\
-memoryprof - Add memory profile\n\
-namespace - Output NAMESPACE file\n\
-no-init-code - Turn off the generation of the R_init_<pkgname> code (registration information still generated)\n\
-package <name> - Package name for the PACKAGE argument of the R .Call() invocations. Default is the module name.\n\
-no-init-code - Turn off the generation of the R_init_<pkgname> code\n\
(registration information still generated)\n\
-package <name> - Package name for the PACKAGE argument of the R .Call()\n\
invocations. Default is the module name.\n\
";

View file

@ -131,16 +131,17 @@ enum autodoc_t {
AUTODOC_SETTER
};
static const char *usage = "\
static const char *usage = (char *) "\
Ruby Options (available with -ruby)\n\
-globalmodule - Wrap everything into the global module\n\
-minherit - Attempt to support multiple inheritance\n\
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-cppcast - Enable C++ casting operators (default)\n\
-autorename - Enable renaming of classes and methods to follow Ruby coding standards\n\
-cppcast - Enable C++ casting operators (default)\n\
-globalmodule - Wrap everything into the global module\n\
-initname <name>- Set entry function to Init_<name> (used by `require')\n\
-minherit - Attempt to support multiple inheritance\n\
-noautorename - Disable renaming of classes and methods (default)\n\
-nocppcast - Disable C++ casting operators, useful for generating bugs\n\
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
-initname <name> - Set entry function to Init_<name> (used by `require')\n";
";
#define RCLASS(hash, name) (RClass*)(Getattr(hash, name) ? Data(Getattr(hash, name)) : 0)

View file

@ -17,6 +17,17 @@ char cvsroot_uffi_cxx[] = "$Id$";
#include "swigmod.h"
static const char *usage = (char *) "\
UFFI Options (available with -uffi)\n\
-identifier-converter <type or funcname> - \n\
Specifies the type of conversion to do on C identifiers\n\
to convert them to symbols. There are two built-in\n\
converters: 'null' and 'lispify'. The default is\n\
'null'. If you supply a name other than one of the\n\
built-ins, then a function by that name will be\n\
called to convert identifiers to symbols.\n\
";
class UFFI:public Language {
public:
@ -222,14 +233,7 @@ void UFFI::main(int argc, char *argv[]) {
}
if (!strcmp(argv[i], "-help")) {
fprintf(stdout, "UFFI Options (available with -uffi)\n");
fprintf(stdout,
" -identifier-converter <type or funcname>\n"
"\tSpecifies the type of conversion to do on C identifiers to convert\n"
"\tthem to symbols. There are two built-in converters: 'null' and\n"
"\t 'lispify'. The default is 'null'. If you supply a name other\n"
"\tthan one of the built-ins, then a function by that name will be\n"
"\tcalled to convert identifiers to symbols.\n");
Printf(stdout, "%s\n", usage);
}
}
}