Skip to content

Commit

Permalink
[driver] add --version=number (#14538)
Browse files Browse the repository at this point in the history
* [driver] add --version-number

Useful for third parties consuming the version number of mono.

* s/--version-number/--version=number/g

* add man page entry
  • Loading branch information
lewurm authored and marek-safar committed May 22, 2019
1 parent e2cc6fc commit 574d87c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions man/mono.1
Expand Up @@ -659,6 +659,9 @@ mscorlib and assemblies located on the global assembly cache.
\fB-V\fR, \fB--version\fR
Prints JIT version information (system configuration, release number
and branch names if available).
.TP
\fB--version=number\fR
Print version number only.


.SH DEVELOPMENT OPTIONS
Expand Down
4 changes: 4 additions & 0 deletions mono/mini/driver.c
Expand Up @@ -1549,6 +1549,7 @@ mini_usage (void)
" --verbose, -v Increases the verbosity level\n"
" --help, -h Show usage information\n"
" --version, -V Show version information\n"
" --version=number Show version number\n"
" --runtime=VERSION Use the VERSION runtime, instead of autodetecting\n"
" --optimize=OPT Turns on or off a specific optimization\n"
" Use --list-opt to get a list of optimizations\n"
Expand Down Expand Up @@ -2047,6 +2048,9 @@ mono_main (int argc, char* argv[])
g_free (full_opts);
} else if (strcmp (argv [i], "--verbose") == 0 || strcmp (argv [i], "-v") == 0) {
mini_verbose_level++;
} else if (strcmp (argv [i], "--version=number") == 0) {
g_print ("%s\n", VERSION);
return 0;
} else if (strcmp (argv [i], "--version") == 0 || strcmp (argv [i], "-V") == 0) {
char *build = mono_get_runtime_build_info ();
char *gc_descr;
Expand Down

0 comments on commit 574d87c

Please sign in to comment.