Add NeoPG commandline wrapper for TREZOR-based agent

It invokes `trezor-gpg-agent` instead of `neopg agent`, by putting
its own path at argv[0].
This commit is contained in:
Roman Zeyde
2018-07-01 12:04:32 +03:00
parent 3b9c00e02a
commit 71b56e15d7

12
contrib/neopg-trezor Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
import os
import shutil
import sys
agent = 'trezor-gpg-agent'
binary = 'neopg'
if sys.argv[1:2] == ['agent']:
os.execvp(agent, [agent, '-vv'] + sys.argv[2:])
else:
os.execvp(binary, [__file__, 'gpg2'] + sys.argv[1:])