]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: (man,usage) correct the markup of the synopsis
authorBenno Schulenberg <bensberg@telfort.nl>
Fri, 27 Jun 2025 12:04:07 +0000 (14:04 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jun 2025 12:09:03 +0000 (14:09 +0200)
Also, use the word "command", to match the wording for the --command
option, and improve the wording of the description of that option.

This fixes 7268e79bc5.

CC: WanBingjiang <wanbingjiang@webray.com.cn>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
term-utils/script.1.adoc
term-utils/script.c

index 688ec5e2dbc2f136677cdcc0b38e67f85d4cc7e1..1bff4245796ec7141c910aa365e3a567ad7b6b7b 100644 (file)
@@ -49,7 +49,7 @@ script - make typescript of terminal session
 
 == SYNOPSIS
 
-*script* [options] [_file_] [ -- program [arguments]]
+*script* [options] [_file_] [*--* _command_ [_argument_...]]
 
 == DESCRIPTION
 
@@ -69,7 +69,8 @@ Below, the _size_ argument may be followed by the multiplicative suffixes KiB (=
 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_.
index 80ea477ab4f355d23fa5bf63101d3f61a83b6af7..7ba57a6a6fda82df444ba8ee1d1a5fe3d5959b83 100644 (file)
@@ -191,7 +191,7 @@ static void __attribute__((__noreturn__)) usage(void)
 {
        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);
@@ -208,8 +208,8 @@ static void __attribute__((__noreturn__)) usage(void)
        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);
@@ -930,7 +930,7 @@ int main(int argc, char **argv)
        /* 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);
                }