3 from bup import options, _hashsplit
4 from bup.helpers import *
7 bup random [-S seed] <numbytes>
9 S,seed= optional random number seed (default 1)
10 f,force print random data to stdout even if it's a tty
12 o = options.Options('bup random', optspec)
13 (opt, flags, extra) = o.parse(sys.argv[1:])
16 o.fatal("exactly one argument expected")
18 total = parse_num(extra[0])
22 if opt.force or (not os.isatty(1) and
23 not atoi(os.environ.get('BUP_FORCE_TTY')) & 1):
24 _hashsplit.write_random(sys.stdout.fileno(), total, opt.seed or 0)
26 log('error: not writing binary data to a terminal. Use -f to force.\n')