rc

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

commit cb4386d79742a1281b064449ca300122bb97a10e
parent d9ced3e5c9db073d7eb2d4c1b70bc25c005a6b37
Author: tjg <tjg>
Date:   Mon, 24 Jul 2000 08:29:59 +0000

  Feature: add `-I' flag (definitively not interactive) for
  compatibility with Plan 9 rc.

Diffstat:
MChangeLog | 5+++++
Mmain.c | 12++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -679,3 +679,8 @@ Changes since rc-1.5b2 Portability: need special runes for read() returning EIO under job control systems. + +2000-06-20 + + Feature: add `-I' flag (definitively not interactive) for + compatibility with Plan 9 rc. diff --git a/main.c b/main.c @@ -2,7 +2,7 @@ #include "rc.h" -bool dashdee, dashee, dashvee, dashex, dashell, dasheye, +bool dashdee, dashee, dashvee, dashex, dashell, dashEYE, dasheye, dashen, dashpee, dashess, interactive; pid_t rc_pid; @@ -19,7 +19,7 @@ extern int main(int argc, char *argv[], char *envp[]) { dollarzero = argv[0]; rc_pid = getpid(); dashell = (*argv[0] == '-'); /* Unix tradition */ - while ((c = rc_getopt(argc, argv, "c:deilnopsvx")) != -1) + while ((c = rc_getopt(argc, argv, "c:deiIlnopsvx")) != -1) switch (c) { case 'c': dashsee[0] = rc_optarg; @@ -30,6 +30,10 @@ extern int main(int argc, char *argv[], char *envp[]) { case 'e': dashee = TRUE; break; + case 'I': + dashEYE = TRUE; + interactive = FALSE; + break; case 'i': dasheye = interactive = TRUE; break; @@ -59,8 +63,8 @@ extern int main(int argc, char *argv[], char *envp[]) { } quitopts: argv += rc_optind; - /* use isatty() iff -i is not set, and iff the input is not from a script or -c flags */ - if (!dasheye && dashsee[0] == NULL && (dashess || *argv == NULL)) + /* use isatty() iff neither -i nor -I is set, and iff the input is not from a script or -c flags */ + if (!dasheye && !dashEYE && dashsee[0] == NULL && (dashess || *argv == NULL)) interactive = isatty(0); if (!dashoh) { checkfd(0, rFrom);