Date: Tue, 27 Sep 2011 16:57:14 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r225802 - user/des/phybs Message-ID: <201109271657.p8RGvEUl032405@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: des Date: Tue Sep 27 16:57:14 2011 New Revision: 225802 URL: http://svn.freebsd.org/changeset/base/225802 Log: Lengthen the progress bar to cover the entire width of the numbers which will replace it, change the indicator character from '|' to 'O', and increase the update frequency. Modified: user/des/phybs/phybs.c Modified: user/des/phybs/phybs.c ============================================================================== --- user/des/phybs/phybs.c Tue Sep 27 16:33:17 2011 (r225801) +++ user/des/phybs/phybs.c Tue Sep 27 16:57:14 2011 (r225802) @@ -56,8 +56,8 @@ static int opt_s; static int opt_w; static int tty = 0; -static char progress[] = " [----------------]" - "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"; +static char progress[] = " [-----------------------]" + "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"; static void scan(int fd, size_t size, off_t offset, off_t step, unsigned int count) @@ -94,10 +94,10 @@ scan(int fd, size_t size, off_t offset, errx(EX_IOERR, "short write: %ld < %lu", (long)wlen, (unsigned long)size); } - if (tty && i % 256 == 0) { - progress[2 + (i * 16) / count] = '|'; + if (tty && i % 16 == 0) { + progress[2 + (i * 23) / count] = 'O'; fputs(progress, stdout); - progress[2 + (i * 16) / count] = '-'; + progress[2 + (i * 23) / count] = '-'; fflush(stdout); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109271657.p8RGvEUl032405>