== SYNOPSIS
-*script* [options] [_file_] [ -- program [arguments]]
+*script* [options] [_file_] [*--* _command_ [_argument_...]]
== DESCRIPTION
Append the output to _file_ or to _typescript_, retaining the prior contents.
*-c*, *--command* _command_::
-Run the _command_ rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves differently when its stdout is not a tty. It's possible to specify the command after '--' too.
+Run the _command_ rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves differently when its stdout is not a tty.
+Instead of using option *-c*, the _command_ may also be specified after a double dash (*--*).
*-E*, *--echo* _when_::
This option controls the *ECHO* flag for the slave end of the session's pseudoterminal. The supported modes are _always_, _never_, or _auto_.
{
FILE *out = stdout;
fputs(USAGE_HEADER, out);
- fprintf(out, _(" %s [options] [file] [-- program [arguments]]\n"), program_invocation_short_name);
+ fprintf(out, _(" %s [options] [<file>] [-- <command> [<argument>...]]\n"), program_invocation_short_name);
fputs(USAGE_SEPARATOR, out);
fputs(_("Make a typescript of a terminal session.\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_(" -a, --append append to the log file\n"), out);
- fputs(_(" -c, --command <command> run command rather than interactive shell\n"
- " (alternative to '-- program [arguments]')\n"), out);
+ fputs(_(" -c, --command <command> run <command> rather than an interactive shell\n"
+ " (alternative to '-- <command> [<argument...>]')\n"), out);
fputs(_(" -e, --return return exit code of the child process\n"), out);
fputs(_(" -f, --flush run flush after each write\n"), out);
fputs(_(" --force use output file even when it is a link\n"), out);
/* concat non-option arguments as command */
if (argc > 0 && strcmp(argv[-1], "--") == 0) {
if (ctl.command != NULL) {
- warnx(_("option --command and '-- program' are mutually exclusive"));
+ warnx(_("option --command and a command after '--' cannot be combined"));
errtryhelp(EXIT_FAILURE);
}