diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-12-09 22:04:11 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-12-10 01:35:44 +0100 |
| commit | 9a80eeccb41a2da42407c08d4a209f734b8d874c (patch) | |
| tree | b90c09b81535c39eabf777db8e8510fb6a4187a3 /fluid | |
| parent | eb4d8d4957d9abd983de51f0c86713809aacbd70 (diff) | |
FLUID: command line argument -v shows fltk version at build time
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/fluid.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index a986c4c51..4216337d1 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -168,6 +168,9 @@ int compile_file = 0; // fluid -c /// Set, if Fluid was started with the command line argument -cs int compile_strings = 0; // fluid -cs +/// Set, if Fluid was started with the command line argument -v +int show_version = 0; // fluid -v + /// Set, if Fluid runs in batch mode, and no user interface is activated. int batch_mode = 0; // if set (-c, -u) don't open display @@ -2113,6 +2116,10 @@ static int arg(int argc, char** argv, int& i) { batch_mode++; i++; return 1; } + if (argv[i][1] == 'v' && !argv[i][2]) { + show_version = 1; + i++; return 1; + } if (argv[i][1] == 'c' && argv[i][2] == 's' && !argv[i][3]) { compile_file++; compile_strings++; @@ -2204,6 +2211,7 @@ int main(int argc,char **argv) { " -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" + " -v : print FLUID version number\n" " -d : enable internal debugging\n"; const char *app_name = NULL; if ( (argc > 0) && argv[0] && argv[0][0] ) @@ -2217,6 +2225,10 @@ int main(int argc,char **argv) { #endif return 1; } + if (show_version) { + printf("FLUID version %d.%d.%d\n", FL_MAJOR_VERSION, FL_MINOR_VERSION, FL_PATCH_VERSION); + ::exit(0); + } const char *c = NULL; if (g_autodoc_path.empty()) |
