X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fhelp-cmd.py;h=4ad5f74d102bfed40764926810fab09d4ec1e32b;hb=3c64b5788c3e6b10528a81285b71da2edbed8950;hp=56a4148c745d1d2183c80107a07d8b9132146fe2;hpb=8c15ca91a77067e3e076d590cf7c2f2d1519afa5;p=bup.git diff --git a/cmd/help-cmd.py b/cmd/help-cmd.py index 56a4148..4ad5f74 100755 --- a/cmd/help-cmd.py +++ b/cmd/help-cmd.py @@ -1,4 +1,11 @@ -#!/usr/bin/env python +#!/bin/sh +"""": # -*-python-*- +bup_python="$(dirname "$0")/bup-python" || exit $? +exec "$bup_python" "$0" ${1+"$@"} +""" +# end of bup preamble + +from __future__ import absolute_import import sys, os, glob from bup import options, path @@ -10,7 +17,7 @@ o = options.Options(optspec) if len(extra) == 0: # the wrapper program provides the default usage string - os.execvp(os.environ['BUP_MAIN_EXE'], ['bup']) + os.execvp(path.exe(), ['bup']) elif len(extra) == 1: docname = (extra[0]=='bup' and 'bup' or ('bup-%s' % extra[0])) manpath = os.path.join(path.exedir(), @@ -21,7 +28,7 @@ elif len(extra) == 1: os.execvp('man', ['man', '-l', g[0]]) else: os.execvp('man', ['man', docname]) - except OSError, e: + except OSError as e: sys.stderr.write('Unable to run man command: %s\n' % e) sys.exit(1) else: