''' % (script, perhaps_installed_tahoe)
sys.exit(1)
-command = prefix + [script] + args
+# Support indirection via another "runner" script (e.g. coverage).
+# For example: bin/tahoe @RUNNER RUNNER_ARGS @tahoe TAHOE_ARGS
+
+if len(args) >= 1 and args[0].startswith('@'):
+ runner = args[0][1:]
+ if runner.endswith('.py') or runner.endswith('.pyscript'):
+ prefix = [sys.executable]
+ else:
+ prefix = []
+
+ def _subst(a):
+ if a == '@tahoe': return script
+ return a
+ command = prefix + [runner] + map(_subst, args[1:])
+else:
+ command = prefix + [script] + args
try:
res = subprocess.call(command, env=os.environ)
Please run e.g. 'tahoe debug dump-share --help' for more details on each
subcommand.
-"""
+
+Another debugging feature is that bin%stahoe allows executing an arbitrary
+"runner" command (typically an installed Python script, such as 'coverage'),
+with the Tahoe libraries on the PYTHONPATH. The runner command name is
+prefixed with '@', and any occurrences of '@tahoe' in its arguments are
+replaced by the full path to the tahoe script.
+
+For example, if 'coverage' is installed and on the PATH, you can use:
+
+ bin%stahoe @coverage run --branch @tahoe debug trial
+
+to get branch coverage for the Tahoe test suite. Or, to run python with
+the -3 option that warns about Python 3 incompatibilities:
+
+ bin%stahoe @python -3 @tahoe command [options]
+""" % (os.sep, os.sep, os.sep)
return t
subDispatch = {