X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cmd%2Frandom-cmd.py;h=3eef820143be8ed3f506ce4af8381c6511fdca71;hb=HEAD;hp=873b511f26428163d65f024fcd0666fca4d28395;hpb=6bfe560d3e08df29d534ebcac7eda2a38c6e9a39;p=bup.git diff --git a/cmd/random-cmd.py b/cmd/random-cmd.py deleted file mode 100755 index 873b511..0000000 --- a/cmd/random-cmd.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -import sys -from bup import options, _helpers -from bup.helpers import * - -optspec = """ -bup random [-S seed] --- -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:]) - -if len(extra) != 1: - o.fatal("exactly one argument expected") - -total = parse_num(extra[0]) - -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, - opt.verbose and 1 or 0) -else: - log('error: not writing binary data to a terminal. Use -f to force.\n') - sys.exit(1)