//usage: "\n"
//usage: "\n -a Append output"
//usage: "\n -c PROG Run PROG, not shell"
-//usage: "\n -f Flush output after each write"
+/* Accepted but has no effect (we never buffer output) */
+/*//usage: "\n -f Flush output after each write"*/
//usage: "\n -q Quiet"
//usage: "\n -t[FILE] Send timing to stderr or FILE"
};
#if ENABLE_LONG_OPTS
- static const char getopt_longopts[] ALIGN1 =
+ static const char script_longopts[] ALIGN1 =
"append\0" No_argument "a"
"command\0" Required_argument "c"
"flush\0" No_argument "f"
"quiet\0" No_argument "q"
"timing\0" Optional_argument "t"
;
-
- applet_long_options = getopt_longopts;
#endif
- opt_complementary = "?1"; /* max one arg */
- opt = getopt32(argv, "ac:fqt::", &shell_arg, &str_t);
+ opt = getopt32long(argv, "^" "ac:fqt::" "\0" "?1"/* max one arg */,
+ script_longopts,
+ &shell_arg, &str_t
+ );
//argc -= optind;
argv += optind;
if (argv[0]) {
}
full_write(STDOUT_FILENO, buf, count);
full_write(outfd, buf, count);
- if (opt & OPT_f) {
- fsync(outfd);
- }
+ // If we'd be using (buffered) FILE i/o, we'd need this:
+ //if (opt & OPT_f) {
+ // fflush(outfd);
+ //}
}
}
if (pfd[1].revents) {