summaryrefslogtreecommitdiffstats
path: root/fish/reopen.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-08-28 12:49:55 +0100
committerRichard Jones <rjones@redhat.com>2010-09-01 14:20:02 +0100
commit54837f6d7ba83178625e2f0c3c063457d9f3f79c (patch)
tree5e42d9ea94780b63007edd18e15ec56791b8b719 /fish/reopen.c
parent3003df6bbc889c3939e6c478462dc4478d5b89f7 (diff)
downloadlibguestfs-54837f6d7ba83178625e2f0c3c063457d9f3f79c.tar.gz
libguestfs-54837f6d7ba83178625e2f0c3c063457d9f3f79c.tar.xz
libguestfs-54837f6d7ba83178625e2f0c3c063457d9f3f79c.zip
fish: Implement progress bars in guestfish.
The progress bar is updated 3 times per second, and is not displayed at all for operations which take less than two seconds. You can disable progress bars by using the flag --no-progress-bars, and you can enable progress bars in non-interactive sessions with the flag --progress-bars. A good way to test this is to use the following command: guestfish --progress-bars \ -N disk:10G \ zero-device /dev/sda (adjust "10G" to get different lengths of time).
Diffstat (limited to 'fish/reopen.c')
-rw-r--r--fish/reopen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fish/reopen.c b/fish/reopen.c
index 2dfc8db6..9e190183 100644
--- a/fish/reopen.c
+++ b/fish/reopen.c
@@ -66,6 +66,9 @@ do_reopen (const char *cmd, int argc, char *argv[])
if (p)
guestfs_set_path (g2, p);
+ if (progress_bars)
+ guestfs_set_progress_callback (g2, progress_callback, NULL);
+
/* Close the original handle. */
guestfs_close (g);
g = g2;