]> arthur.barton.de Git - bup.git/blobdiff - cmd/random-cmd.py
cmd/split: print a progress counter.
[bup.git] / cmd / random-cmd.py
index 19732b9e18e519abd5848f6ca8a6f1954230638e..873b511f26428163d65f024fcd0666fca4d28395 100755 (executable)
@@ -8,6 +8,7 @@ bup random [-S seed] <numbytes>
 --
 S,seed=   optional random number seed [1]
 f,force   print random data to stdout even if it's a tty
+v,verbose print byte counter to stderr
 """
 o = options.Options('bup random', optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
@@ -21,7 +22,8 @@ handle_ctrl_c()
 
 if opt.force or (not os.isatty(1) and
                  not atoi(os.environ.get('BUP_FORCE_TTY')) & 1):
-    _helpers.write_random(sys.stdout.fileno(), total, opt.seed)
+    _helpers.write_random(sys.stdout.fileno(), total, opt.seed,
+                          opt.verbose and 1 or 0)
 else:
     log('error: not writing binary data to a terminal. Use -f to force.\n')
     sys.exit(1)