summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjg <tjg>2000-07-24 08:29:59 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:18 +0100
commitcb4386d79742a1281b064449ca300122bb97a10e (patch)
treeaf5cbc356a1c321a42a9e5cef2d88d27f67415cc
parentd9ced3e5c9db073d7eb2d4c1b70bc25c005a6b37 (diff)
Feature: add `-I' flag (definitively not interactive) for
compatibility with Plan 9 rc.
-rw-r--r--ChangeLog5
-rw-r--r--main.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f48915..14b616b 100644
--- 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
index d526bd1..57a79c3 100644
--- 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);