3 from bup import options, _helpers
4 from bup.helpers import *
7 bup random [-S seed] <numbytes>
9 S,seed= optional random number seed [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 _helpers.write_random(sys.stdout.fileno(), total, opt.seed)
26 log('error: not writing binary data to a terminal. Use -f to force.\n')