]> arthur.barton.de Git - bup.git/blob - lib/cmd/ls-cmd.py
Prefer python 3, and mention intent to drop python 2 support
[bup.git] / lib / cmd / ls-cmd.py
1 #!/bin/sh
2 """": # -*-python-*-
3 # https://sourceware.org/bugzilla/show_bug.cgi?id=26034
4 export "BUP_ARGV_0"="$0"
5 arg_i=1
6 for arg in "$@"; do
7     export "BUP_ARGV_${arg_i}"="$arg"
8     shift
9     arg_i=$((arg_i + 1))
10 done
11 # Here to end of preamble replaced during install
12 bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
13 exec "$bup_python" "$0"
14 """
15 # end of bup preamble
16
17 from __future__ import absolute_import
18 import os.path, sys
19
20 sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
21
22 from bup import compat, git, ls
23 from bup.io import byte_stream
24
25
26 git.check_repo_or_die()
27
28 sys.stdout.flush()
29 out = byte_stream(sys.stdout)
30 # Check out lib/bup/ls.py for the opt spec
31 rc = ls.via_cmdline(compat.argv[1:], out=out)
32 sys.exit(rc)