3 # https://sourceware.org/bugzilla/show_bug.cgi?id=26034
4 export "BUP_ARGV_0"="$0"
7 export "BUP_ARGV_${arg_i}"="$arg"
11 # Here to end of preamble replaced during install
12 bup_python="$(dirname "$0")/bup-python" || exit $?
13 exec "$bup_python" "$0"
17 from __future__ import absolute_import
20 from bup import compat, options, _helpers
21 from bup.helpers import atoi, handle_ctrl_c, log, parse_num
25 bup random [-S seed] <numbytes>
27 S,seed= optional random number seed [1]
28 f,force print random data to stdout even if it's a tty
29 v,verbose print byte counter to stderr
31 o = options.Options(optspec)
32 (opt, flags, extra) = o.parse(compat.argv[1:])
35 o.fatal("exactly one argument expected")
37 total = parse_num(extra[0])
41 if opt.force or (not os.isatty(1) and
42 not atoi(os.environ.get('BUP_FORCE_TTY')) & 1):
43 _helpers.write_random(sys.stdout.fileno(), total, opt.seed,
44 opt.verbose and 1 or 0)
46 log('error: not writing binary data to a terminal. Use -f to force.\n')