rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit f63b6ec11153ee4105110962826d4a503161b12a
parent 7a1805b6f42215f37522166a6ec3de6de042bee6
Author: tgoodwin <tgoodwin>
Date:   Fri, 13 Feb 1998 12:04:10 +0000

add -V option

Diffstat:
Mmain.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -11,7 +11,9 @@ static bool dashoh; static void assigndefault(char *,...); static void checkfd(int, enum redirtype); -extern void main(int argc, char *argv[], char *envp[]) { +static const char id[] = "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $"; + +extern int main(int argc, char *argv[], char *envp[]) { char *dashsee[2], *dollarzero, *null[1]; int c; initprint(); @@ -19,7 +21,7 @@ extern void main(int argc, char *argv[], char *envp[]) { dollarzero = argv[0]; rc_pid = getpid(); dashell = (*argv[0] == '-'); /* Unix tradition */ - while ((c = rc_getopt(argc, argv, "nolpeivdxsc:")) != -1) + while ((c = rc_getopt(argc, argv, "Vnolpeivdxsc:")) != -1) switch (c) { case 'l': dashell = TRUE; @@ -54,6 +56,9 @@ extern void main(int argc, char *argv[], char *envp[]) { case 'o': dashoh = TRUE; break; + case 'V': + fprint(1, "%s\n", id); + exit(0); case '?': exit(1); } @@ -97,6 +102,7 @@ quitopts: dasheye = FALSE; doit(TRUE); rc_exit(getstatus()); + return 0; /* Never really reached. */ } static void assigndefault(char *name,...) {