All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] script: --quiet option is not quiet.
@ 2014-06-21 23:03 Andreas Henriksson
  2014-06-22  1:12 ` [PATCH 2/2] script: silence the done message on --quiet as well Andreas Henriksson
  2014-06-23  9:42 ` [PATCH] script: --quiet option is not quiet Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Henriksson @ 2014-06-21 23:03 UTC (permalink / raw)
  To: util-linux; +Cc: James Hunt, Andreas Henriksson

From: James Hunt <james.hunt@ubuntu.com>

Specifying 'script --quiet ...' still produces the 'Script started'
message in the typescript file. The --quiet option implies that the
script program should not log any of its output to the typescript file.

Originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693966

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 term-utils/script.1 | 3 ++-
 term-utils/script.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/term-utils/script.1 b/term-utils/script.1
index 60a0e53..67e1066 100644
--- a/term-utils/script.1
+++ b/term-utils/script.1
@@ -82,7 +82,8 @@ 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\-q\fR, \fB\-\-quiet\fR
-Be quiet.
+Be quiet (do not write start and done messages to either standard output
+or the typescript file).
 .TP
 \fB\-t\fR, \fB\-\-timing\fR[=\fIfile\fR]
 Output timing data to standard error, or to
diff --git a/term-utils/script.c b/term-utils/script.c
index 1530e67..21fb5af 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -437,7 +437,8 @@ dooutput(void) {
 
 	tvec = time((time_t *)NULL);
 	my_strftime(obuf, sizeof obuf, "%c\n", localtime(&tvec));
-	fprintf(fscript, _("Script started on %s"), obuf);
+	if (!qflg)
+		fprintf(fscript, _("Script started on %s"), obuf);
 
 	FD_ZERO(&readfds);
 
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] script: silence the done message on --quiet as well
  2014-06-21 23:03 [PATCH] script: --quiet option is not quiet Andreas Henriksson
@ 2014-06-22  1:12 ` Andreas Henriksson
  2014-06-23  9:42 ` [PATCH] script: --quiet option is not quiet Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Henriksson @ 2014-06-22  1:12 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

Apparently James Hunts patch (which he provided a long time
ago) is no longer covering it all.

This followup patch also silences the "Script done ..." message
when --quiet is used.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 term-utils/script.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/term-utils/script.c b/term-utils/script.c
index 21fb5af..2da7512 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -578,7 +578,8 @@ done(void) {
 			char buf[BUFSIZ];
 			tvec = time((time_t *)NULL);
 			my_strftime(buf, sizeof buf, "%c\n", localtime(&tvec));
-			fprintf(fscript, _("\nScript done on %s"), buf);
+			if (!qflg)
+				fprintf(fscript, _("\nScript done on %s"), buf);
 
 			if (close_stream(fscript) != 0)
 				errx(EXIT_FAILURE, _("write error"));
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] script: --quiet option is not quiet.
  2014-06-21 23:03 [PATCH] script: --quiet option is not quiet Andreas Henriksson
  2014-06-22  1:12 ` [PATCH 2/2] script: silence the done message on --quiet as well Andreas Henriksson
@ 2014-06-23  9:42 ` Karel Zak
  1 sibling, 0 replies; 3+ messages in thread
From: Karel Zak @ 2014-06-23  9:42 UTC (permalink / raw)
  To: Andreas Henriksson; +Cc: util-linux, James Hunt

On Sun, Jun 22, 2014 at 01:03:04AM +0200, Andreas Henriksson wrote:
>  term-utils/script.1 | 3 ++-
>  term-utils/script.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)

Both patches applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-23  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 23:03 [PATCH] script: --quiet option is not quiet Andreas Henriksson
2014-06-22  1:12 ` [PATCH 2/2] script: silence the done message on --quiet as well Andreas Henriksson
2014-06-23  9:42 ` [PATCH] script: --quiet option is not quiet Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.