]> arthur.barton.de Git - bup.git/blobdiff - cmd/random-cmd.py
Clean subprocess output without newliner
[bup.git] / cmd / random-cmd.py
index 873b511f26428163d65f024fcd0666fca4d28395..868c3afd3fcebf2a775bc7e5e5a0b63dfd31239b 100755 (executable)
@@ -1,7 +1,15 @@
-#!/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
+
+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] <numbytes>
@@ -10,7 +18,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: