3 # https://sourceware.org/bugzilla/show_bug.cgi?id=26034
4 export "BUP_ARGV_0"="$0"
7 export "BUP_ARGV_${arg_i}"="$arg"
11 # Here to end of preamble replaced during install
12 bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
13 exec "$bup_python" "$0"
17 from __future__ import absolute_import
20 sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
22 from bup import compat, options, path
28 o = options.Options(optspec)
29 opt, flags, extra = o.parse(compat.argv[1:])
32 # the wrapper program provides the default usage string
33 os.execvp(path.exe(), ['bup'])
35 docname = (extra[0]=='bup' and 'bup' or ('bup-%s' % extra[0]))
36 manpath = os.path.join(path.exedir(),
37 '../../Documentation/' + docname + '.[1-9]')
38 g = glob.glob(manpath)
41 os.execvp('man', ['man', '-l', g[0]])
43 os.execvp('man', ['man', docname])
45 sys.stderr.write('Unable to run man command: %s\n' % e)
48 o.fatal("exactly one command name expected")