diff options
| author | tjg <tjg> | 2000-07-24 08:29:59 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:18 +0100 |
| commit | cb4386d79742a1281b064449ca300122bb97a10e (patch) | |
| tree | af5cbc356a1c321a42a9e5cef2d88d27f67415cc /main.c | |
| parent | d9ced3e5c9db073d7eb2d4c1b70bc25c005a6b37 (diff) | |
Feature: add `-I' flag (definitively not interactive) for
compatibility with Plan 9 rc.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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); |