+2015-04-13 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-options.c: Include version.h.
+ (OPTIONS_VERSION): New enum.
+ (standard_options): Add "version".
+ (standard_option_handler): Handle OPTIONS_VERSION.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (version.o): Change to using create-version.sh from gdb.
#include "sim-options.h"
#include "sim-io.h"
#include "sim-assert.h"
+#include "version.h"
#include "bfd.h"
OPTION_MEM_SIZE,
#endif
OPTION_HELP,
+ OPTION_VERSION,
#ifdef SIM_H8300 /* FIXME: Should be movable to h8300 dir. */
OPTION_H8300H,
OPTION_H8300S,
{ {"help", no_argument, NULL, OPTION_HELP},
'H', NULL, "Print help information",
standard_option_handler },
+ { {"version", no_argument, NULL, OPTION_VERSION},
+ '\0', NULL, "Print version information",
+ standard_option_handler },
{ {"architecture", required_argument, NULL, OPTION_ARCHITECTURE},
'\0', "MACHINE", "Specify the architecture to use",
/* FIXME: 'twould be nice to do something similar if gdb. */
break;
+ case OPTION_VERSION:
+ sim_io_printf (sd, "GNU simulator %s%s\n", PKGVERSION, version);
+ if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)
+ exit (0);
+ break;
+
case OPTION_SYSROOT:
/* Don't leak memory in the odd event that there's lots of
--sysroot=... options. We treat "" specially since this