]> arthur.barton.de Git - bup.git/blobdiff - cmd/newliner-cmd.py
Never omit explicitly named mounts during index -x
[bup.git] / cmd / newliner-cmd.py
index 966725e8fe8ac337e8bc00d70f240f6ae54bff1c..20027ab104a1e495b4abff2b9853e1818430b3ed 100755 (executable)
@@ -1,4 +1,9 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
 import sys, os, re
 from bup import options
 from bup import _helpers   # fixes up sys.argv on import
@@ -15,6 +20,7 @@ if extra:
 r = re.compile(r'([\r\n])')
 lastlen = 0
 all = ''
+width = options._tty_width() or 78
 while 1:
     l = r.split(all, 1)
     if len(l) <= 1:
@@ -32,6 +38,8 @@ while 1:
     else:
         assert(len(l) == 3)
         (line, splitchar, all) = l
+        if splitchar == '\r':
+            line = line[:width]
         sys.stdout.write('%-*s%s' % (lastlen, line, splitchar))
         if splitchar == '\r':
             lastlen = len(line)