diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2011-01-06 21:36:04 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2011-01-06 21:36:04 +0000 |
| commit | 3ed49c079381fe66eb4c75caf0cf27ac31a16258 (patch) | |
| tree | 4abdaca86b6a3f9c7d3da89219f29fb02f0afe6b /fluid | |
| parent | 22111debb86ae720d29325ddcdd6e7fd59de0ec4 (diff) | |
STR 2510: send Fluid help string to an FLTK dialog box for Visual Studio builds.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8202 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/fluid.cxx | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 064156241..53306f8bd 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -2298,20 +2298,32 @@ int main(int argc,char **argv) { int i = 1; if (!Fl::args(argc,argv,i,arg) || i < argc-1) { - fprintf(stderr, -"usage: %s <switches> name.fl\n" -" -c : write .cxx and .h and exit\n" -" -cs : write .cxx and .h and strings and exit\n" -" -o <name> : .cxx output filename, or extension if <name> starts with '.'\n" -" -h <name> : .h output filename, or extension if <name> starts with '.'\n" - , argv[0]); + static const char *msg = + "usage: %s <switches> name.fl\n" + " -c : write .cxx and .h and exit\n" + " -cs : write .cxx and .h and strings and exit\n" + " -o <name> : .cxx output filename, or extension if <name> starts with '.'\n" + " -h <name> : .h output filename, or extension if <name> starts with '.'\n"; + int len = strlen(msg) + strlen(argv[0]) + strlen(Fl::help); Fl_Plugin_Manager pm("commandline"); int i, n = pm.plugins(); for (i=0; i<n; i++) { Fl_Commandline_Plugin *pi = (Fl_Commandline_Plugin*)pm.plugin(i); - if (pi) puts(pi->help()); + if (pi) len += strlen(pi->help()); } - fprintf(stderr, "%s\n", Fl::help); + char *buf = (char*)malloc(len+1); + sprintf(buf, msg, argv[0]); + for (i=0; i<n; i++) { + Fl_Commandline_Plugin *pi = (Fl_Commandline_Plugin*)pm.plugin(i); + if (pi) strcat(buf, pi->help()); + } + strcat(buf, Fl::help); +#ifdef _MSC_VER + fl_message("%s\n", buf); +#else + fprintf(stderr, "%s\n", buf); +#endif + free(buf); return 1; } if (exit_early) |
