summaryrefslogtreecommitdiff
path: root/sim/ppc/psim.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/ppc/psim.c')
-rw-r--r--sim/ppc/psim.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index be9d076cd66..c311794db7a 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -119,7 +119,7 @@ find_arg(char *err_msg,
INLINE_PSIM\
(void)
-psim_usage(int verbose)
+psim_usage(int verbose, int help)
{
printf_filtered("Usage:\n");
printf_filtered("\n");
@@ -217,7 +217,10 @@ psim_usage(int verbose)
printf_filtered("\n");
print_options();
}
- error("");
+
+ if (REPORT_BUGS_TO[0])
+ printf ("Report bugs to %s\n", REPORT_BUGS_TO);
+ exit (help ? 0 : 1);
}
/* Test "string" for containing a string of digits that form a number
@@ -258,7 +261,7 @@ psim_options(device *root,
while (*p != '\0') {
switch (*p) {
default:
- psim_usage(0);
+ psim_usage(0, 0);
error ("");
break;
case 'c':
@@ -279,7 +282,7 @@ psim_options(device *root,
else
{
printf_filtered ("Invalid <endian> option for -E (target-endian)\n");
- psim_usage (0);
+ psim_usage (0, 0);
}
break;
case 'f':
@@ -288,10 +291,10 @@ psim_options(device *root,
break;
case 'h':
case '?':
- psim_usage(1);
+ psim_usage(1, 1);
break;
case 'H':
- psim_usage(2);
+ psim_usage(2, 1);
break;
case 'i':
if (isdigit(p[1])) {
@@ -352,6 +355,14 @@ psim_options(device *root,
p = argv[argp] + strlen(argv[argp]) - 1;
printf_filtered("Warning - architecture parameter ignored\n");
}
+ else if (strcmp (argv[argp], "--help") == 0)
+ psim_usage (0, 1);
+ else if (strcmp (argv[argp], "--version") == 0)
+ {
+ extern const char version[];
+ printf ("GNU simulator %s%s\n", PKGVERSION, version);
+ exit (0);
+ }
else
error("Unrecognized option");
break;