Commit 15f3d1ea 15f3d1ea73e60026f8bbe7d9ce4b613a987bc17e by Sergey Poznyakoff

(mh_getopt): Implemented -version option.

1 parent 7ea39bc2
......@@ -53,6 +53,10 @@ mh_getopt (int argc, char **argv, struct mh_option *mh_opt, const char *doc)
return 0;
}
if (strcmp (mh_optptr, "-version") == 0)
asprintf (&argv[mh_optind], "--version");
else
{
optlen = strlen (mh_optptr+1);
for (p = mh_opt; p->opt; p++)
{
......@@ -98,6 +102,7 @@ mh_getopt (int argc, char **argv, struct mh_option *mh_opt, const char *doc)
}
else
mh_optind++;
}
return '?';
}
......@@ -137,6 +142,7 @@ mh_help (struct mh_option *mh_opt, const char *doc)
printf ("\n");
}
printf (" -help\n");
printf (" -version\n");
printf (_("\nPlease use GNU long options instead.\n"
"Run %s --help for more info on these.\n"),
program_invocation_short_name);
......