summaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
authorFred Mora2018-05-14 11:20:06 +0200
committerKarel Zak2018-05-14 11:32:23 +0200
commitaefe9893385f05c40ae44a6b9e782cf96751e4dd (patch)
treeaaa54a4d055d97fc5d7b493552f8e6c4d68de364 /bash-completion
parentbash-completion: add findmnt --real --pseudo (diff)
downloadkernel-qcow2-util-linux-aefe9893385f05c40ae44a6b9e782cf96751e4dd.tar.gz
kernel-qcow2-util-linux-aefe9893385f05c40ae44a6b9e782cf96751e4dd.tar.xz
kernel-qcow2-util-linux-aefe9893385f05c40ae44a6b9e782cf96751e4dd.zip
script: add the -o/--output-limit option. Fix race test.
When script is used on a host with a relatively small free disk space, it is sometimes desirable to limit the size of the captured output. This can now be enforced with the --output-limit option. The --output-limit option lets the user specify a maximum size. The program uses the size parsing from strutils and thus supports the usual multiplicative suffixes (kiB, KB, MiB, MB, etc.). After the specified number of bytes have been written to the output file, the script program will terminate the child process. Due to buffering, the size of the output file might exceed the specified limit. This limit also does not include the start and done messages. The race test was throwing an error dur to a variable being "" in some cases. Quoting the variable in the equal test took care of that test. [kzak@redhat.com: - use done() to stop script - count also timing file - remove unnamed member initialization in ctl struct - add to bash-completion] Signed-off-by: Fred Mora <fmora@datto.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'bash-completion')
-rw-r--r--bash-completion/script1
1 files changed, 1 insertions, 0 deletions
diff --git a/bash-completion/script b/bash-completion/script
index d7efd7e7c..57b91a9eb 100644
--- a/bash-completion/script
+++ b/bash-completion/script
@@ -25,6 +25,7 @@ _script_module()
--flush
--force
--quiet
+ --output-limit
--timing=
--version
--help"