.PP
If the argument
.I file
-is given,
+or option \fB\-\-log\-out\fR \fIfile\fR is given,
.B script
saves the dialogue in this
.IR file .
Allow the default output destination, i.e. the typescript file, to be a hard
or symbolic link. The command will follow a symbolic link.
.TP
+\fB\-O\fR, \fB\-\-log\-out\fR \fIfile\fR
+Log output to the \fIfile\fR. The default is to log the file with name 'typescript'
+if the option is not given.
+.TP
\fB\-o\fR, \fB\-\-output-limit\fR \fIsize\fR
Limit the size of the typescript and timing files to
.I size
fputs(_("Make a typescript of a terminal session.\n"), out);
fputs(USAGE_OPTIONS, out);
+ fputs(_(" -O, --log-out <file> log stdout to file (default)\n"), out);
fputs(_(" -a, --append append the output\n"), out);
fputs(_(" -c, --command <command> run command rather than interactive shell\n"), out);
fputs(_(" -e, --return return exit code of the child process\n"), out);
{"return", no_argument, NULL, 'e'},
{"flush", no_argument, NULL, 'f'},
{"force", no_argument, NULL, FORCE_OPTION,},
+ {"log-out", required_argument, NULL, 'O'},
{"output-limit", required_argument, NULL, 'o'},
{"quiet", no_argument, NULL, 'q'},
{"timing", optional_argument, NULL, 't'},
script_init_debug();
- while ((ch = getopt_long(argc, argv, "ac:efo:qt::Vh", longopts, NULL)) != -1)
+ while ((ch = getopt_long(argc, argv, "ac:efO:o:qt::Vh", longopts, NULL)) != -1)
switch (ch) {
case 'a':
ctl.append = 1;
case FORCE_OPTION:
ctl.force = 1;
break;
+ case 'O':
+ typescript = optarg;
+ break;
case 'o':
ctl.maxsz = strtosize_or_err(optarg, _("failed to parse output limit size"));
break;
argc -= optind;
argv += optind;
- if (argc > 0)
- typescript = argv[0];
- else
- die_if_link(&ctl, DEFAULT_TYPESCRIPT_FILENAME);
+ if (!typescript) {
+ if (argc > 0)
+ typescript = argv[0];
+ else
+ die_if_link(&ctl, DEFAULT_TYPESCRIPT_FILENAME);
+ }
/* associate stdout with typescript file */
log_associate(&ctl, &ctl.out, typescript, SCRIPT_FMT_RAW);