X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cmd%2Frandom-cmd.py;h=3eef820143be8ed3f506ce4af8381c6511fdca71;hb=053869284db064aa21b2249981ec6affa489e296;hp=873b511f26428163d65f024fcd0666fca4d28395;hpb=b63d3e3da43d4a68d328518fcd3ae481334859b4;p=bup.git diff --git a/cmd/random-cmd.py b/cmd/random-cmd.py index 873b511..3eef820 100755 --- a/cmd/random-cmd.py +++ b/cmd/random-cmd.py @@ -1,7 +1,16 @@ -#!/usr/bin/env python -import sys +#!/bin/sh +"""": # -*-python-*- +bup_python="$(dirname "$0")/bup-python" || exit $? +exec "$bup_python" "$0" ${1+"$@"} +""" +# end of bup preamble + +from __future__ import absolute_import +import os, sys + from bup import options, _helpers -from bup.helpers import * +from bup.helpers import atoi, handle_ctrl_c, log, parse_num + optspec = """ bup random [-S seed] @@ -10,7 +19,7 @@ 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) +o = options.Options(optspec) (opt, flags, extra) = o.parse(sys.argv[1:]) if len(extra) != 1: