blasphemy: allow passing in args after --run for convenience
This commit is contained in:
parent
00bbf3300b
commit
cb8f881ce2
@ -84,7 +84,7 @@ def print_paths(paths):
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--wrap", action="store_true", help="output wrapper script to stdout")
|
||||
parser.add_argument("--run", action="store_true", help="run command with specified args")
|
||||
parser.add_argument("--run", nargs="*", help="run command with specified args")
|
||||
parser.add_argument("--command", help="command to wrap or run (default to the first input binary)")
|
||||
parser.add_argument("--arguments", nargs="+", default=[], help="Additional arguments to pass to command")
|
||||
parser.add_argument("--inputs", nargs="+", default=[], help="input binaries to scan for dependencies")
|
||||
@ -107,10 +107,10 @@ if (not command) and args.inputs:
|
||||
#command[0] = os.path.abspath(command[0])
|
||||
|
||||
command = pre_command + [command] + args.arguments
|
||||
if args.run:
|
||||
if args.run is not None:
|
||||
environment = {"LD_LIBRARY_PATH": make_ld_library_path(paths)}
|
||||
environment.update(os.environ)
|
||||
completed_process = run(command, env=environment)
|
||||
completed_process = run(command + args.run, env=environment)
|
||||
sys.exit(completed_process.returncode)
|
||||
elif args.wrap:
|
||||
print(generate_wrapper(paths, command))
|
||||
|
Loading…
x
Reference in New Issue
Block a user