]> arthur.barton.de Git - bup.git/blobdiff - cmd/ls-cmd.py
get: adjust for python 3 and test there
[bup.git] / cmd / ls-cmd.py
index 031fbaefd7aba78339df53162d66b1773c8ce11d..28ecc535113d40d49c90b83db87757d9af99ceac 100755 (executable)
@@ -4,14 +4,18 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys
-from bup import git, vfs, ls
-from bup.helpers import *
+
+from bup import git, ls
+from bup.io import byte_stream
 
 
 git.check_repo_or_die()
-top = vfs.RefList(None)
 
+sys.stdout.flush()
+out = byte_stream(sys.stdout)
 # Check out lib/bup/ls.py for the opt spec
-ret = ls.do_ls(sys.argv[1:], top, default='/', spec_prefix='bup ')
-sys.exit(ret)
+rc = ls.via_cmdline(sys.argv[1:], out=out)
+sys.exit(rc)